QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#275405 | #5304. Money Game | chitoge# | WA | 0ms | 3952kb | C++20 | 676b | 2023-12-04 18:00:17 | 2023-12-04 18:00:18 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<double> a(n);
double ans = 0 , sum = 0;
for(auto &it : a) cin >> it , sum += it;
int mx = 100;
while(mx--) {
for(int i = 0 ; i < n ; ++i) {
if(i == n - 1) {
a[i] /= 2;
a[0] += a[i];
}
else {
a[i] /= 2;
a[i + 1] += a[i];
}
}
}
for(auto it : a) cout << it << ' ' , sum += it;
cout << '\n';
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3952kb
input:
2 4 2
output:
4 2
result:
ok 2 numbers
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3916kb
input:
2 2 3
output:
3.33333 1.66667
result:
wrong answer 2nd numbers differ - expected: '1.6666667', found: '1.6666700', error = '0.0000020'