QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#506158 | #6423. Fireworks | jinfuyu | WA | 2ms | 4160kb | C++14 | 385b | 2024-08-05 15:45:01 | 2024-08-05 15:45:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
double n,m,p;
cin>>n>>m>>p;
p/=10000;
double mi=1e9;
for(int i=1;i<=10000;i++){
double d=(n*i+m)/(1-pow(1-p,i));
mi=min(mi,d);
}
printf("%.6lf\n",mi);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 4160kb
input:
3 1 1 5000 1 1 1 1 2 10000
output:
4.000000 10141.585289 3.000000
result:
ok 3 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 4100kb
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.729806 200.348432 177.346278 416.839878 90.293454 149.569421 190.672507 164.601521 139.349701 275.133110 167.364017 207.190737 300.732218 589.058849 101.877028 10796.887267 229.792148 303.937370 153.441934 68.534570
result:
ok 20 numbers
Test #3:
score: -100
Wrong Answer
time: 2ms
memory: 4112kb
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:
1000000000.000000 1000000000.000000 1000000000.000000 1000000000.000000 1000000000.000000 1000000000.000000 1000000000.000000 1000000000.000000 1000000000.000000 1000000000.000000
result:
wrong answer 1st numbers differ - expected: '1980003919.02917', found: '1000000000.00000', error = '0.49495'