QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#807165#9851. Cup of Waterrotcar07AC ✓6ms4104kbC++23354b2024-12-09 19:30:162024-12-09 19:30:17

Judging History

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

  • [2024-12-09 19:30:17]
  • 评测
  • 测评结果:AC
  • 用时:6ms
  • 内存:4104kb
  • [2024-12-09 19:30:16]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
constexpr int N=2e5+5;
int main(){
	std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t;cin>>t;
	while(t--){
		double x;cin>>x;x=1/x;
		double ans=0,w=1;
		for(int k=0;k<=x;k++){
			if(k){w=w/k*-1;}
			ans+=w*pow(x-k,k)*pow(M_E,x-k);
		}
		cout<<fixed<<setprecision(10)<<ans<<'\n';
	}
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
0.3
1.5

output:

7.3332227396
1.9477340411

result:

ok 2 numbers

Test #2:

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

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.0021341520
1.0000003580
1.0166305301
1.0264731113
1.0002252275
3.0929049786
1.0000019060
1.0000039593
2.7269254735
1.0000002723
1.0000000125
1.0001782636
1.0282834831
1.0000000147
1.0000010843
1.0000231979
1.0000126900
4.0131586961
1.0112434172
3.8084916171
1.0000073805
1.0000000030
1.0000027885
1...

result:

ok 9768 numbers

Test #3:

score: 0
Accepted
time: 6ms
memory: 4044kb

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.2133966767
1.0002178647
1.0002493880
1.0000077388
1.0014604443
1.1151267464
1.0115795744
1.0000000641
1.0220917235
1.8358974111
1.0110711421
1.0002801393
1.0252015659
1.0000001321
2.9998835754
1.0000107537
1.0000494723
1.0000001548
1.0000022891
1.6002274017
1.0001870213
1.0449202768
1.0000000014
2...

result:

ok 9481 numbers

Test #4:

score: 0
Accepted
time: 6ms
memory: 4104kb

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.0207625191
1.0012251687
3.3046740129
1.0017716137
1.0150237580
1.0630116076
1.0000005968
1.0010657367
1.0010536519
1.0033660708
1.0000001255
1.0000000055
1.1277788966
1.0000013517
1.0000000020
23.6551724138
1.0000000106
1.0000188232
6.2696933278
1.0000000189
4.6943625330
1.0009865843
27.6936936943...

result:

ok 9834 numbers

Extra Test:

score: 0
Extra Test Passed