QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#275405#5304. Money Gamechitoge#WA 0ms3952kbC++20676b2023-12-04 18:00:172023-12-04 18:00:18

Judging History

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

  • [2023-12-04 18:00:18]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3952kb
  • [2023-12-04 18:00:17]
  • 提交

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'