QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#606996#6423. Fireworkskarito#WA 3ms3932kbC++17511b2024-10-03 13:31:422024-10-03 13:31:48

Judging History

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

  • [2024-10-03 13:31:48]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3932kb
  • [2024-10-03 13:31:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m,p;

void solve(){
    cin>>n>>m>>p;
    double q = 1.0-(p/10000.0);
    double t = q;
    double ans = 1.0*(n+m)/(1-q);
    for(int i=2;i<=10000;i++){
        q*=t;
        ans=min(ans,1.0*(n*i+m)/(1-q));
    }
    cout<<ans<<endl;
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout<<fixed<<setprecision(10);
    int T;
    cin >> T;
    while(T--) solve();
    return 0;
}

详细

Test #1:

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

input:

3
1 1 5000
1 1 1
1 2 10000

output:

4.0000000000
10141.5852891148
3.0000000000

result:

ok 3 numbers

Test #2:

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

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:

89.7298056505
200.3484320557
177.3462783172
416.8398778004
90.2934537246
149.5694213627
190.6725070858
164.6015211156
139.3497013935
275.1331102484
167.3640167364
207.1907373553
300.7322175732
589.0588489505
101.8770282124
10796.8872669046
229.7921478060
303.9373704812
153.4419337888
68.5345696432

result:

ok 20 numbers

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3932kb

input:

10
954269343 987322500 9806
916720797 981711601 9728
902477101 957414437 9250
967013471 988735825 9674
985383693 926528961 9411
970653208 917703218 9331
998423148 911924940 9283
986159007 902133513 9759
953796828 947934512 9959
995334734 931874197 9944

output:

-2147376429.0000000000
-2147277089.0000000000
-2147011630.0000000000
-2147467204.0000000000
-2147380339.0000000000
-2147376054.0000000000
-2146899140.0000000000
-2146689167.0000000000
-2146877352.0000000000
-2145575777.0000000000

result:

wrong answer 1st numbers differ - expected: '1980003919.02917', found: '-2147376429.00000', error = '2.08453'