QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#180320#7247. Hans Zimmermendicillin2AC ✓22ms11940kbC++171013b2023-09-15 18:13:162023-09-15 18:13:17

Judging History

你现在查看的是最新测评结果

  • [2023-09-15 18:13:17]
  • 评测
  • 测评结果:AC
  • 用时:22ms
  • 内存:11940kb
  • [2023-09-15 18:13:16]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

template <class T> int sz(T&& a) { return int(size(forward<T>(a))); }

template <class T> using vc = vector<T>;
template <class T> using vvc = vc<vc<T>>;

using ll = int64_t;
using vi = vc<int>;

template <class F>
struct ycr {
	F f;
	
	template <class T>
	explicit ycr(T&& f_) : f(forward<T>(f_)) {}

	template <class... Args>
	decltype(auto) operator()(Args&&... args) {
		return f(ref(*this), forward<Args>(args)...);
	}
};
template <class F>
decltype(auto) yc(F&& f) {
	return ycr<decay_t<F>>(forward<F>(f));
}

using D = double;
const int N=1e6+5;
D pre[N];

int main() {
	ios_base::sync_with_stdio(false), cin.tie(nullptr);
	cout << fixed << setprecision(40);
	int w,h,n;
	pre[0]=0;
	cin>>w>>h>>n;
	for(int i=1;i<=n;i++) pre[i]=pre[i-1]+log(i);
	D ans = 0;
	const D c = log(w) + log(h) - n * log(2);
	for(int x=0;x<=n;x++)
	{
		ans+=exp(c + pre[n]-pre[x]-pre[n-x]-log(x+1)*2-log(n-x+1)*2);
	}
	cout<<ans<<"\n";
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 4052kb

input:

2 4 1

output:

1.9999999999999995559107901499373838305473

result:

ok jury = 2, participant = 2, relative error = 2.220446049e-16

Test #2:

score: 0
Accepted
time: 0ms
memory: 4024kb

input:

42 24 2

output:

87.5000000000000142108547152020037174224854

result:

ok jury = 87.5, participant = 87.5, relative error = 1.624097682e-16

Test #3:

score: 0
Accepted
time: 0ms
memory: 4056kb

input:

1 1 5

output:

0.0092013888888888891587347629297255480196

result:

ok jury = 0.009201388889, participant = 0.009201388889, relative error = 1.207543499e-11

Test #4:

score: 0
Accepted
time: 0ms
memory: 4052kb

input:

1 1 1

output:

0.2500000000000000555111512312578270211816

result:

ok jury = 0.25, participant = 0.25, relative error = 2.220446049e-16

Test #5:

score: 0
Accepted
time: 0ms
memory: 4112kb

input:

1 1000 1

output:

249.9999999999998863131622783839702606201172

result:

ok jury = 250, participant = 250, relative error = 4.547473509e-16

Test #6:

score: 0
Accepted
time: 0ms
memory: 4188kb

input:

1000 1 1

output:

249.9999999999998863131622783839702606201172

result:

ok jury = 250, participant = 250, relative error = 4.547473509e-16

Test #7:

score: 0
Accepted
time: 0ms
memory: 4084kb

input:

1000 1000 1

output:

249999.9999999998253770172595977783203125000000

result:

ok jury = 250000, participant = 250000, relative error = 6.98491931e-16

Test #8:

score: 0
Accepted
time: 0ms
memory: 4052kb

input:

1 1000 5

output:

9.2013888888888875072780137998051941394806

result:

ok jury = 9.201388889, participant = 9.201388889, relative error = 1.207566575e-11

Test #9:

score: 0
Accepted
time: 0ms
memory: 4024kb

input:

1000 1000 5

output:

9201.3888888888868677895516157150268554687500

result:

ok jury = 9201.388889, participant = 9201.388889, relative error = 1.207567347e-11

Test #10:

score: 0
Accepted
time: 0ms
memory: 3892kb

input:

1 1 10

output:

0.0009391233428172652848014978488322412886

result:

ok jury = 0.0009391233428, participant = 0.0009391233428, relative error = 1.838445313e-11

Test #11:

score: 0
Accepted
time: 0ms
memory: 4088kb

input:

1 1 2

output:

0.0868055555555555524716027093745651654899

result:

ok jury = 0.08680555556, participant = 0.08680555556, relative error = 5.120000423e-11

Test #12:

score: 0
Accepted
time: 0ms
memory: 4064kb

input:

1 1 3

output:

0.0364583333333333425851918718763045035303

result:

ok jury = 0.03645833333, participant = 0.03645833333, relative error = 9.142876932e-11

Test #13:

score: 0
Accepted
time: 0ms
memory: 4112kb

input:

1 1 4

output:

0.0174421296296296268746317537079448811710

result:

ok jury = 0.01744212963, participant = 0.01744212963, relative error = 2.123444088e-11

Test #14:

score: 0
Accepted
time: 0ms
memory: 4048kb

input:

1 1 100

output:

0.0000001507872879412524133182447192216835

result:

ok jury = 1.507872879e-07, participant = 1.507872879e-07, relative error = 2.7358016e-10

Test #15:

score: 0
Accepted
time: 0ms
memory: 4188kb

input:

1000 1000 100

output:

0.1507872879412526512243886145370197482407

result:

ok jury = 0.1507872879, participant = 0.1507872879, relative error = 2.735816842e-10

Test #16:

score: 0
Accepted
time: 0ms
memory: 4140kb

input:

1 1 1000

output:

0.0000000000159043986921765944506471946231

result:

ok jury = 1.590439869e-11, participant = 1.590439869e-11, relative error = 1.368548001e-10

Test #17:

score: 0
Accepted
time: 0ms
memory: 4100kb

input:

1000 1000 1000

output:

0.0000159043986921648119136057236699954842

result:

ok jury = 1.590439869e-05, participant = 1.590439869e-05, relative error = 1.361141007e-10

Test #18:

score: 0
Accepted
time: 1ms
memory: 4204kb

input:

1 1 10000

output:

0.0000000000000015990403993597509965956508

result:

ok jury = 1.5990404e-15, participant = 1.599040399e-15, relative error = 4.00395748e-10

Test #19:

score: 0
Accepted
time: 1ms
memory: 4128kb

input:

1000 1000 10000

output:

0.0000000015990403993600207152325831715198

result:

ok jury = 1.5990404e-09, participant = 1.599040399e-09, relative error = 4.002270988e-10

Test #20:

score: 0
Accepted
time: 3ms
memory: 4968kb

input:

1 1 100000

output:

0.0000000000000000001599904007748992639292

result:

ok jury = 1.599904004e-19, participant = 1.599904008e-19, relative error = 2.343260959e-09

Test #21:

score: 0
Accepted
time: 3ms
memory: 6508kb

input:

1000 1000 100000

output:

0.0000000000001599904007749261244272837720

result:

ok jury = 1.599904004e-13, participant = 1.599904008e-13, relative error = 2.343428879e-09

Test #22:

score: 0
Accepted
time: 22ms
memory: 11924kb

input:

1 1 1000000

output:

0.0000000000000000000000159998997037664242

result:

ok jury = 1.5999904e-23, participant = 1.59998997e-23, relative error = 2.685162096e-07

Test #23:

score: 0
Accepted
time: 18ms
memory: 11940kb

input:

1000 1000 1000000

output:

0.0000000000000000159998997335713264737931

result:

ok jury = 1.5999904e-17, participant = 1.599989973e-17, relative error = 2.666533919e-07

Test #24:

score: 0
Accepted
time: 0ms
memory: 5112kb

input:

1 1 123456

output:

0.0000000000000000000688731696671339787055

result:

ok jury = 6.887316951e-20, participant = 6.887316967e-20, relative error = 2.281497668e-09

Test #25:

score: 0
Accepted
time: 4ms
memory: 6980kb

input:

1000 1000 123456

output:

0.0000000000000688731696671454908061310357

result:

ok jury = 6.887316951e-14, participant = 6.887316967e-14, relative error = 2.281664768e-09

Test #26:

score: 0
Accepted
time: 10ms
memory: 8176kb

input:

1 1 424243

output:

0.0000000000000000000004939182524406778679

result:

ok jury = 4.939182799e-22, participant = 4.939182524e-22, relative error = 5.559486917e-08

Test #27:

score: 0
Accepted
time: 10ms
memory: 8780kb

input:

1000 1000 424243

output:

0.0000000000000004939182524407641055486006

result:

ok jury = 4.939182799e-16, participant = 4.939182524e-16, relative error = 5.559469455e-08

Test #28:

score: 0
Accepted
time: 0ms
memory: 4128kb

input:

1 1 20

output:

0.0000753731487305570974034527043095010868

result:

ok jury = 7.537314873e-05, participant = 7.537314873e-05, relative error = 7.391275848e-12

Test #29:

score: 0
Accepted
time: 0ms
memory: 4152kb

input:

1 1 30

output:

0.0000162971064032072323647659661816078369

result:

ok jury = 1.62971064e-05, participant = 1.62971064e-05, relative error = 1.967976754e-10

Test #30:

score: 0
Accepted
time: 0ms
memory: 4120kb

input:

1 1 50

output:

0.0000022768228277982309983224797067524747

result:

ok jury = 2.276822828e-06, participant = 2.276822828e-06, relative error = 8.861874309e-11

Test #31:

score: 0
Accepted
time: 0ms
memory: 4052kb

input:

1 1 200

output:

0.0000000097061491119674908537430600002915

result:

ok jury = 9.706149112e-09, participant = 9.706149112e-09, relative error = 3.349407892e-12

Test #32:

score: 0
Accepted
time: 0ms
memory: 4060kb

input:

1 1 300

output:

0.0000000019363452300404378486634051855821

result:

ok jury = 1.93634523e-09, participant = 1.93634523e-09, relative error = 2.088365462e-11

Test #33:

score: 0
Accepted
time: 0ms
memory: 3896kb

input:

1 1 500

output:

0.0000000002529534331286488163398590618436

result:

ok jury = 2.529534331e-10, participant = 2.529534331e-10, relative error = 1.132573355e-10

Test #34:

score: 0
Accepted
time: 0ms
memory: 4064kb

input:

1 1 700

output:

0.0000000000660710939676932551663060238091

result:

ok jury = 6.607109397e-11, participant = 6.607109397e-11, relative error = 3.491312306e-11

Test #35:

score: 0
Accepted
time: 0ms
memory: 4108kb

input:

1 1 2000

output:

0.0000000000009970062397551143308828250265

result:

ok jury = 9.970062398e-13, participant = 9.970062398e-13, relative error = 4.502043578e-11

Test #36:

score: 0
Accepted
time: 0ms
memory: 4172kb

input:

1 1 3000

output:

0.0000000000001971363505733205480243584372

result:

ok jury = 1.971363506e-13, participant = 1.971363506e-13, relative error = 1.353350229e-10

Test #37:

score: 0
Accepted
time: 0ms
memory: 4128kb

input:

1 1 5000

output:

0.0000000000000255693055849953517867227769

result:

ok jury = 2.556930558e-14, participant = 2.556930558e-14, relative error = 1.953651508e-10

Test #38:

score: 0
Accepted
time: 1ms
memory: 4252kb

input:

1 1 7000

output:

0.0000000000000066581815387039009111542331

result:

ok jury = 6.658181538e-15, participant = 6.658181539e-15, relative error = 1.057196446e-10

Test #39:

score: 0
Accepted
time: 0ms
memory: 4340kb

input:

1 1 20000

output:

0.0000000000000000999700061976197460821582

result:

ok jury = 9.997000625e-17, participant = 9.99700062e-17, relative error = 5.239596869e-10

Test #40:

score: 0
Accepted
time: 1ms
memory: 4128kb

input:

1 1 30000

output:

0.0000000000000000197491363710278154187073

result:

ok jury = 1.974913635e-17, participant = 1.974913637e-17, relative error = 1.064746036e-09

Test #41:

score: 0
Accepted
time: 1ms
memory: 4564kb

input:

1 1 50000

output:

0.0000000000000000025596928188294729353356

result:

ok jury = 2.559692826e-18, participant = 2.559692819e-18, relative error = 2.801323329e-09

Test #42:

score: 0
Accepted
time: 2ms
memory: 4632kb

input:

1 1 70000

output:

0.0000000000000000006663318865859003621097

result:

ok jury = 6.663318889e-19, participant = 6.663318866e-19, relative error = 3.472893492e-09

Test #43:

score: 0
Accepted
time: 2ms
memory: 5676kb

input:

1 1 200000

output:

0.0000000000000000000099997000504083354836

result:

ok jury = 9.999700006e-21, participant = 9.99970005e-21, relative error = 4.440966697e-09

Test #44:

score: 0
Accepted
time: 7ms
memory: 6680kb

input:

1 1 300000

output:

0.0000000000000000000019752690311411594850

result:

ok jury = 1.975269136e-21, participant = 1.975269031e-21, relative error = 5.308584975e-08

Test #45:

score: 0
Accepted
time: 7ms
memory: 8572kb

input:

1 1 500000

output:

0.0000000000000000000002559969267970977949

result:

ok jury = 2.55996928e-22, participant = 2.559969268e-22, relative error = 4.6988932e-09

Extra Test:

score: 0
Extra Test Passed