QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#563771#9257. Post-capitalismPhantomThreshold#AC ✓3ms4012kbC++20418b2024-09-14 15:51:332024-09-14 15:51:34

Judging History

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

  • [2024-09-14 15:51:34]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:4012kb
  • [2024-09-14 15:51:33]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

typedef long double db;
const int maxn=2000;
db sum[maxn+50];
int n;
db a;

int main(){
    ios_base::sync_with_stdio(false);
    cin >> n;
    cin >> a;
    for (int i=1;i<=n;i++){
        for (int j=i;j>=1;j--) sum[i]=sum[i]+(db)1.0/j;
    }
    db ans=a+(1-n*a)*(sum[n-1]/(n-1));
    cout << fixed << setprecision(12) << ans << "\n";
    return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 0.01

output:

0.990000000000

result:

ok found '0.9900000', expected '0.9900000', error '0.0000000'

Test #2:

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

input:

100 0.01

output:

0.010000000000

result:

ok found '0.0100000', expected '0.0100000', error '0.0000000'

Test #3:

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

input:

5 0.198802992

output:

0.201920200333

result:

ok found '0.2019202', expected '0.2019202', error '0.0000000'

Test #4:

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

input:

77 0.0023

output:

0.055512541842

result:

ok found '0.0555125', expected '0.0555125', error '0.0000000'

Test #5:

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

input:

2000 0.000000001

output:

0.004090972360

result:

ok found '0.0040910', expected '0.0040910', error '0.0000000'

Test #6:

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

input:

2 0.000000001

output:

0.999999999000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'

Test #7:

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

input:

123 0.000000001

output:

0.044142040419

result:

ok found '0.0441420', expected '0.0441420', error '0.0000000'

Test #8:

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

input:

10 0.021646285

output:

0.267935365351

result:

ok found '0.2679354', expected '0.2679354', error '0.0000000'

Test #9:

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

input:

2 0.448174878

output:

0.551825122000

result:

ok found '0.5518251', expected '0.5518251', error '0.0000000'

Test #10:

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

input:

3 0.298813113

output:

0.376483608750

result:

ok found '0.3764836', expected '0.3764836', error '0.0000000'

Test #11:

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

input:

239 0.003150763

output:

0.009430367448

result:

ok found '0.0094304', expected '0.0094304', error '0.0000000'

Test #12:

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

input:

265 0.003568216

output:

0.004837061522

result:

ok found '0.0048371', expected '0.0048371', error '0.0000000'

Test #13:

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

input:

1492 0.000575770

output:

0.001321152376

result:

ok found '0.0013212', expected '0.0013212', error '0.0000000'

Test #14:

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

input:

1855 0.000138690

output:

0.003384663117

result:

ok found '0.0033847', expected '0.0033847', error '0.0000000'

Test #15:

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

input:

1999 0.000005980

output:

0.004049831569

result:

ok found '0.0040498', expected '0.0040498', error '0.0000000'

Test #16:

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

input:

2000 0.000078622

output:

0.003526319555

result:

ok found '0.0035263', expected '0.0035263', error '0.0000000'

Test #17:

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

input:

2 0.499999999

output:

0.500000001000

result:

ok found '0.5000000', expected '0.5000000', error '0.0000000'

Test #18:

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

input:

3 0.333333332

output:

0.333333335000

result:

ok found '0.3333333', expected '0.3333333', error '0.0000000'

Test #19:

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

input:

17 0.058823528

output:

0.058823533071

result:

ok found '0.0588235', expected '0.0588235', error '0.0000000'

Test #20:

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

input:

2000 0.000499999

output:

0.000500007182

result:

ok found '0.0005000', expected '0.0005000', error '0.0000000'

Test #21:

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

input:

1789 0.000558970

output:

0.000558982045

result:

ok found '0.0005590', expected '0.0005590', error '0.0000000'

Test #22:

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

input:

503 0.001988071

output:

0.001988074886

result:

ok found '0.0019881', expected '0.0019881', error '0.0000000'

Test #23:

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

input:

2000 0.0005

output:

0.000500000000

result:

ok found '0.0005000', expected '0.0005000', error '0.0000000'

Extra Test:

score: 0
Extra Test Passed