QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#784077 | #6423. Fireworks | surenjamts# | WA | 1ms | 3832kb | C++20 | 845b | 2024-11-26 13:09:03 | 2024-11-26 13:09:07 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define S second
#define F first
void solve(){
double p, n, m;
cin >> n >> m >> p;
double P = 1;
double ev = 1e18;
int ans = 0;
for(double x = 1; x <= 10000; x+=1.0){
P *= (1.0 - p / 10000.0);
double N = n * x + m;
double evx = 1.0 /(1.0 - P);
// cout << P << " " << evx << " " << evx * N << '\n';
if(evx * N < ev) ans = x;
ev = min(ev, evx * N);
}
//cout << P << '\n';
// cout << 1.0 / (1.0 - P) << endl;
// cout << ans << '\n';
// cout << setprecision(18) << ev << '\n';
printf("%.6lf",ev);
}
int main(){
ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
int t; cin >> t; while(t--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3832kb
input:
3 1 1 5000 1 1 1 1 2 10000
output:
4.00000010141.5852893.000000
result:
wrong output format Expected double, but "4.00000010141.5852893.000000" found