QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#607040 | #6423. Fireworks | karito# | WA | 1ms | 3916kb | C++17 | 562b | 2024-10-03 13:44:27 | 2024-10-03 13:44:27 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,m,p;
const double esp = 1e-5;
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<=100000;i++){
q*=t;
ans=min(ans,1.0*(n*i+m)/(1-q));
if(q<esp) break;
}
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: 1ms
memory: 3916kb
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: 1ms
memory: 3860kb
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: 3872kb
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:
-1399632875.8291471004 -1480909737.2600145340 -1541268291.1376492977 -1373664404.5826141834 -1402536643.1477746964 -1442413341.5756895542 -1393359166.2039461136 -1421341298.2394304276 -1439463325.3784995079 -1372466671.5548200607
result:
wrong answer 1st numbers differ - expected: '1980003919.02917', found: '-1399632875.82915', error = '1.70688'