QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#180054#7247. Hans Zimmermendicillin2#WA 22ms11900kbC++17966b2023-09-15 15:07:542023-09-15 15:07:54

Judging History

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

  • [2023-09-15 15:07:54]
  • 评测
  • 测评结果:WA
  • 用时:22ms
  • 内存:11900kb
  • [2023-09-15 15:07:54]
  • 提交

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(20);
	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";
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 4120kb

input:

2 4 1

output:

1.99999999999999955591

result:

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

Test #2:

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

input:

42 24 2

output:

87.50000000000001421085

result:

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

Test #3:

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

input:

1 1 5

output:

0.00920138888888888916

result:

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

Test #4:

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

input:

1 1 1

output:

0.25000000000000005551

result:

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

Test #5:

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

input:

1 1000 1

output:

249.99999999999988631316

result:

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

Test #6:

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

input:

1000 1 1

output:

249.99999999999988631316

result:

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

Test #7:

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

input:

1000 1000 1

output:

249999.99999999982537701726

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.20138888888888750728

result:

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

Test #9:

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

input:

1000 1000 5

output:

9201.38888888888686778955

result:

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

Test #10:

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

input:

1 1 10

output:

0.00093912334281726528

result:

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

Test #11:

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

input:

1 1 2

output:

0.08680555555555555247

result:

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

Test #12:

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

input:

1 1 3

output:

0.03645833333333334259

result:

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

Test #13:

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

input:

1 1 4

output:

0.01744212962962962687

result:

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

Test #14:

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

input:

1 1 100

output:

0.00000015078728794125

result:

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

Test #15:

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

input:

1000 1000 100

output:

0.15078728794125265122

result:

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

Test #16:

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

input:

1 1 1000

output:

0.00000000001590439869

result:

ok jury = 1.590439869e-11, participant = 1.590439869e-11, relative error = 0

Test #17:

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

input:

1000 1000 1000

output:

0.00001590439869216481

result:

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

Test #18:

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

input:

1 1 10000

output:

0.00000000000000159904

result:

ok jury = 1.5990404e-15, participant = 1.59904e-15, relative error = 2.501500274e-07

Test #19:

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

input:

1000 1000 10000

output:

0.00000000159904039936

result:

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

Test #20:

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

input:

1 1 100000

output:

0.00000000000000000016

result:

ok jury = 1.599904004e-19, participant = 1.6e-19, relative error = 5.99975e-05

Test #21:

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

input:

1000 1000 100000

output:

0.00000000000015999040

result:

ok jury = 1.599904004e-13, participant = 1.599904e-13, relative error = 2.500149923e-09

Test #22:

score: -100
Wrong Answer
time: 22ms
memory: 11900kb

input:

1 1 1000000

output:

0.00000000000000000000

result:

wrong answer jury = 1.5999904e-23, participant = 0, relative error = 1