QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#613748#6423. Fireworksiokanux#WA 9ms4148kbC++20549b2024-10-05 14:38:182024-10-05 14:38:34

Judging History

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

  • [2024-10-05 14:38:34]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:4148kb
  • [2024-10-05 14:38:18]
  • 提交

answer

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

void solve(){
    int n,m,p;cin>>n>>m>>p;
    double ga=double(p)*1.0/10000;
    double ans=0;
    for(int i=2;i<=17009;i++){
        double res=((1-ga)/ga)*(1-pow(1-ga,i-1))*double(n+m)+double(n+m)-pow(1-ga,i)*double(n*i+m*i);
        ans=max(ans,res);
    }
    cout<<fixed<<setprecision(9)<<ans<<"\n";
}

signed main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int T=1;
    cin>>T;
    while(T--){
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 4148kb

input:

3
1 1 5000
1 1 1
1 2 10000

output:

4.000000000
10141.517287256
3.000000000

result:

ok 3 numbers

Test #2:

score: -100
Wrong Answer
time: 9ms
memory: 4140kb

input:

20
10 27 2855
79 59 6888
65 72 7725
78 50 2888
31 21 5759
41 58 6619
47 27 3881
35 55 5095
77 7 6028
17 89 1792
84 60 8604
58 44 4923
88 27 3824
54 63 1482
19 42 5366
93 76 97
100 99 8660
96 36 4343
90 56 9515
24 44 9922

output:

129.597197898
200.348432056
177.346278317
443.213296399
90.293453725
149.569421363
190.672507086
176.643768400
139.349701393
591.517857143
167.364016736
207.190737355
300.732217573
789.473684211
113.678717853
17422.680412371
229.792147806
303.937370481
153.441933789
68.534569643

result:

wrong answer 1st numbers differ - expected: '89.72981', found: '129.59720', error = '0.44430'