QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#578712#9257. Post-capitalismucup-team004#AC ✓0ms3936kbC++20534b2024-09-20 20:57:022024-09-20 20:57:03

Judging History

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

  • [2024-09-20 20:57:03]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3936kb
  • [2024-09-20 20:57:02]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

using F = long double;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    std::cout << std::fixed << std::setprecision(10);
    
    int n;
    F a;
    std::cin >> n >> a;
    
    F ans = 0;
    
    ans += (n - 1) * (1 - a) + (1 - n * a) / n;
    
    for (int i = 1; i <= n; i++) {
        ans -= (1 - n * a) / i;
    }
    ans /= (n - 1);
    ans = 1 - ans;
    
    std::cout << ans << "\n";
    
    return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 0.01

output:

0.9900000000

result:

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

Test #2:

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

input:

100 0.01

output:

0.0100000000

result:

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

Test #3:

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

input:

5 0.198802992

output:

0.2019202003

result:

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

Test #4:

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

input:

77 0.0023

output:

0.0555125418

result:

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

Test #5:

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

input:

2000 0.000000001

output:

0.0040909724

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.9999999990

result:

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

Test #7:

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

input:

123 0.000000001

output:

0.0441420404

result:

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

Test #8:

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

input:

10 0.021646285

output:

0.2679353654

result:

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

Test #9:

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

input:

2 0.448174878

output:

0.5518251220

result:

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

Test #10:

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

input:

3 0.298813113

output:

0.3764836088

result:

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

Test #11:

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

input:

239 0.003150763

output:

0.0094303674

result:

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

Test #12:

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

input:

265 0.003568216

output:

0.0048370615

result:

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

Test #13:

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

input:

1492 0.000575770

output:

0.0013211524

result:

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

Test #14:

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

input:

1855 0.000138690

output:

0.0033846631

result:

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

Test #15:

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

input:

1999 0.000005980

output:

0.0040498316

result:

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

Test #16:

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

input:

2000 0.000078622

output:

0.0035263196

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.5000000010

result:

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

Test #18:

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

input:

3 0.333333332

output:

0.3333333350

result:

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

Test #19:

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

input:

17 0.058823528

output:

0.0588235331

result:

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

Test #20:

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

input:

2000 0.000499999

output:

0.0005000072

result:

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

Test #21:

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

input:

1789 0.000558970

output:

0.0005589820

result:

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

Test #22:

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

input:

503 0.001988071

output:

0.0019880749

result:

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

Test #23:

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

input:

2000 0.0005

output:

0.0005000000

result:

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

Extra Test:

score: 0
Extra Test Passed