QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#823391 | #9851. Cup of Water | ucup-team902 | AC ✓ | 10ms | 4220kb | C++20 | 509b | 2024-12-20 23:10:23 | 2024-12-20 23:10:23 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
void solve() {
double x;
cin >> x;
x = 1 / x;
double ans = 0;
for (long long i = 0, fc = 1; i <= x; ++i) {
if (i) fc *= i;
ans += exp(x - i) / fc * pow(i - x, i);
}
cout << fixed << setprecision(9) << ans << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T = 1;
cin >> T;
while (T--) solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 4044kb
input:
2 0.3 1.5
output:
7.333222740 1.947734041
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 10ms
memory: 4220kb
input:
9768 469.070 2793122.738 60.629 38.272 4440.455 0.827 524662.883 252568.142 0.995 3671899.832 79928893.659 5610.170 35.854 68047411.273 922221.868 43107.778 78802.653 0.597 89.440 0.635 135492.601 333002831.372 358615.056 866489.073 7.063 93903.502 228265.165 81.685 4.846 0.239 8.012 0.472 298346.57...
output:
1.002134152 1.000000358 1.016630530 1.026473111 1.000225228 3.092904979 1.000001906 1.000003959 2.726925474 1.000000272 1.000000013 1.000178264 1.028283483 1.000000015 1.000001084 1.000023198 1.000012690 4.013158696 1.011243417 3.808491617 1.000007381 1.000000003 1.000002789 1.000001154 1.152096005 ...
result:
ok 9768 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 4120kb
input:
9481 5.170 4590.505 4010.316 129218.949 685.223 9.177 86.858 15598091.009 45.764 1.646 90.824 3570.153 40.178 7571947.997 0.863 92991.413 20213.817 6460787.667 436851.685 2.127 5347.485 22.758 706071741.355 0.895 85680.844 71146.743 925487.929 0.050 11888033.354 0.770 0.355 6.717 806444425.289 76145...
output:
1.213396677 1.000217865 1.000249388 1.000007739 1.001460444 1.115126746 1.011579574 1.000000064 1.022091724 1.835897411 1.011071142 1.000280139 1.025201566 1.000000132 2.999883575 1.000010754 1.000049472 1.000000155 1.000002289 1.600227402 1.000187021 1.044920277 1.000000001 2.924724674 1.000011671 ...
result:
ok 9481 numbers
Test #4:
score: 0
Accepted
time: 3ms
memory: 4064kb
input:
9834 48.662 816.714 0.757 564.957 67.060 16.365 1675672.130 938.818 949.580 297.582 7969223.994 181272831.436 8.316 739836.043 503469326.139 0.087 94738708.518 53126.478 0.357 52867747.208 0.497 1014.098 0.074 293444325.193 3976.668 854597.795 0.086 6161.729 4752653.330 4875.171 5154.889 38209.591 9...
output:
1.020762519 1.001225169 3.304674013 1.001771614 1.015023758 1.063011608 1.000000597 1.001065737 1.001053652 1.003366071 1.000000125 1.000000006 1.127778897 1.000001352 1.000000002 23.655172414 1.000000011 1.000018823 6.269693328 1.000000019 4.694362533 1.000986584 27.693693693 1.000000003 1.00025149...
result:
ok 9834 numbers
Extra Test:
score: 0
Extra Test Passed