QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#279509 | #5304. Money Game | zzuqy# | WA | 1ms | 3740kb | C++20 | 940b | 2023-12-08 20:23:46 | 2023-12-08 20:23:46 |
Judging History
answer
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <stack>
#include <vector>
#include <algorithm>
#include <queue>
#include <bitset>
using namespace std;
const int N = 1e5 +9 ;
typedef long long ll;
int read() {
int x = 0, s = 1; char ch = getchar();
for (; !isdigit(ch); ch = getchar()) if (ch == '-') s = -1;
for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ 48);
return x * s;
}
int n;
double a[N];
int main() {
ios::sync_with_stdio(false);
cin >> n;
double sum = 0;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
sum += a[i];
}
// for (int j = 0; j < 1000; ++j) {
// for (int i = 1; i <= n; ++i) {
// a[(i % n) + 1] += a[i] / 2;
// a[i] /= 2;
// }
// }
cout << sum / (n + 1) * 2 << ' ';
for (int i = 2; i <= n; ++i) {
cout << sum / (n + 1) << ' ';
}
cout << '\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3648kb
input:
2 4 2
output:
4 2
result:
ok 2 numbers
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3740kb
input:
2 2 3
output:
3.33333 1.66667
result:
wrong answer 2nd numbers differ - expected: '1.6666667', found: '1.6666700', error = '0.0000020'