QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#761782 | #5304. Money Game | s1amese | WA | 0ms | 3812kb | C++20 | 443b | 2024-11-19 10:14:42 | 2024-11-19 10:14:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<double> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < min(n, 1000); i++) {
for (int j = 0; j < n; j++) {
a[(j + 1) % n] += a[j] / 2;
a[j] /= 2;
}
}
for (int i = 0; i < n; i++)
cout << fixed << setprecision(8) << a[i] << " \n"[i == n - 1];
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3812kb
input:
2 4 2
output:
4.00000000 2.00000000
result:
ok 2 numbers
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3812kb
input:
2 2 3
output:
3.25000000 1.75000000
result:
wrong answer 1st numbers differ - expected: '3.3333333', found: '3.2500000', error = '0.0250000'