QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#180029#7247. Hans Zimmermendicillin2#WA 108ms19600kbC++17958b2023-09-15 14:45:512023-09-15 14:45:52

Judging History

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

  • [2023-09-15 14:45:52]
  • 评测
  • 测评结果:WA
  • 用时:108ms
  • 内存:19600kb
  • [2023-09-15 14:45:51]
  • 提交

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));
}
#define double long double
const int N=1e6+5;
double 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);
	double ans=0;
	for(int x=0;x<=n;x++)
	{
		ans+=exp(pre[n]-pre[x]-pre[n-x]-log(x+1)*2-log(n-x+1)*2-n*log(2));
	}
	ans=ans*w*h;
	cout<<ans<<"\n";
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 4 1

output:

2.00000000000000013921

result:

ok jury = 2, participant = 2, relative error = 0

Test #2:

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

input:

42 24 2

output:

87.49999999999999609340

result:

ok jury = 87.5, participant = 87.5, relative error = 0

Test #3:

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

input:

1 1 5

output:

0.00920138888888888863

result:

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

Test #4:

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

input:

1 1 1

output:

0.25000000000000001740

result:

ok jury = 0.25, participant = 0.25, relative error = 0

Test #5:

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

input:

1 1000 1

output:

250.00000000000001740275

result:

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

Test #6:

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

input:

1000 1 1

output:

250.00000000000001740275

result:

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

Test #7:

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

input:

1000 1000 1

output:

250000.00000000001740829703

result:

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

Test #8:

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

input:

1 1000 5

output:

9.20138888888888863138

result:

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

Test #9:

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

input:

1000 1000 5

output:

9201.38888888888863082371

result:

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

Test #10:

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

input:

1 1 10

output:

0.00093912334281726479

result:

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

Test #11:

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

input:

1 1 2

output:

0.08680555555555555168

result:

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

Test #12:

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

input:

1 1 3

output:

0.03645833333333334044

result:

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

Test #13:

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

input:

1 1 4

output:

0.01744212962962963153

result:

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

Test #14:

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

input:

1 1 100

output:

0.00000015078728794124

result:

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

Test #15:

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

input:

1000 1000 100

output:

0.15078728794124499472

result:

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

Test #16:

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

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: 1ms
memory: 3876kb

input:

1000 1000 1000

output:

0.00001590439869216689

result:

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

Test #18:

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

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: 2ms
memory: 4040kb

input:

1000 1000 10000

output:

0.00000000159904039987

result:

ok jury = 1.5990404e-09, participant = 1.5990404e-09, relative error = 8.129883314e-11

Test #20:

score: 0
Accepted
time: 12ms
memory: 5532kb

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: 12ms
memory: 7188kb

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: 108ms
memory: 19600kb

input:

1 1 1000000

output:

0.00000000000000000000

result:

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