QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#180044 | #7247. Hans Zimmer | mendicillin2# | WA | 1ms | 3920kb | C++17 | 977b | 2023-09-15 14:59:24 | 2023-09-15 14:59:24 |
Judging History
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 = long double;
const int N=1e6+5;
D pre[N];
int main() {
ios_base::sync_with_stdio(false), cin.tie(nullptr);
cout << fixed << setprecision(10);
int w,h,n;
pre[0]=0;
cin>>w>>h>>n;
for(int i=1;i<=n;i++) pre[i]=pre[i-1]+logl(i);
D ans = 0;
const D c = logl(w) + logl(h) - n * logl(2);
for(int x=0;x<=n;x++)
{
ans+=exp(c + pre[n]-pre[x]-pre[n-x]-logl(x+1)*2-logl(n-x+1)*2);
}
cout<<ans<<"\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3920kb
input:
2 4 1
output:
2.0000000000
result:
ok jury = 2, participant = 2, relative error = 0
Test #2:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
42 24 2
output:
87.5000000000
result:
ok jury = 87.5, participant = 87.5, relative error = 0
Test #3:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
1 1 5
output:
0.0092013889
result:
ok jury = 0.009201388889, participant = 0.0092013889, relative error = 1.195471645e-09
Test #4:
score: 0
Accepted
time: 0ms
memory: 3896kb
input:
1 1 1
output:
0.2500000000
result:
ok jury = 0.25, participant = 0.25, relative error = 0
Test #5:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
1 1000 1
output:
250.0000000000
result:
ok jury = 250, participant = 250, relative error = 0
Test #6:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
1000 1 1
output:
250.0000000000
result:
ok jury = 250, participant = 250, relative error = 0
Test #7:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
1000 1000 1
output:
250000.0000000000
result:
ok jury = 250000, participant = 250000, relative error = 0
Test #8:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
1 1000 5
output:
9.2013888889
result:
ok jury = 9.201388889, participant = 9.201388889, relative error = 1.086792543e-11
Test #9:
score: 0
Accepted
time: 1ms
memory: 3900kb
input:
1000 1000 5
output:
9201.3888888889
result:
ok jury = 9201.388889, participant = 9201.388889, relative error = 1.207428967e-11
Test #10:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
1 1 10
output:
0.0009391233
result:
ok jury = 0.0009391233428, participant = 0.0009391233, relative error = 4.557441822e-08
Test #11:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
1 1 2
output:
0.0868055556
result:
ok jury = 0.08680555556, participant = 0.0868055556, relative error = 4.608000379e-10
Test #12:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
1 1 3
output:
0.0364583333
result:
ok jury = 0.03645833333, participant = 0.0364583333, relative error = 8.22857211e-10
Test #13:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
1 1 4
output:
0.0174421296
result:
ok jury = 0.01744212963, participant = 0.0174421296, relative error = 1.719973401e-09
Test #14:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
1 1 100
output:
0.0000001508
result:
ok jury = 1.507872879e-07, participant = 1.508e-07, relative error = 8.429774536e-05
Test #15:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
1000 1000 100
output:
0.1507872879
result:
ok jury = 0.1507872879, participant = 0.1507872879, relative error = 0
Test #16:
score: -100
Wrong Answer
time: 0ms
memory: 3824kb
input:
1 1 1000
output:
0.0000000000
result:
wrong answer jury = 1.590439869e-11, participant = 0, relative error = 1