QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#656860 | #5304. Money Game | iliyian# | WA | 0ms | 3928kb | C++23 | 1.0kb | 2024-10-19 13:47:34 | 2024-10-19 13:47:35 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
int qpow(int a, int b, int mod) {
int ans = 1;
while (b) {
if (b & 1) ans = ans * a % mod;
a = a * a % mod;
b >>= 1;
}
return ans;
}
void solve() {
int n;
std::cin >> n;
std::vector<int> a(n + 1);
std::vector<double> ans(n + 1);
int sum = 0;
for (int i = 1; i <= n; i++) {
std::cin >> a[i];
sum += a[i];
ans[i] = a[i];
}
// for (int t = 1; t <= 10000; t++) {
// int p = t % n + 1;
// ans[p % n + 1] += ans[p] / 2;
// ans[p] /= 2;
// }
// for (int i = 1; i <= n; i++) {
// std::cout << ans[i] << ' ';
// }
// // return;
double t = (double)sum / (n + 1);
int pos = qpow(2022, 1204, n);
pos++;
for (int i = 1; i <= n; i++) {
std::cout << std::fixed << std::setprecision(20) << t * (i == (n - pos + 1) ? 2 : 1) << ' ';
}
std::cout << '\n';
}
signed main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int t = 1;
while (t--) {
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3928kb
input:
2 4 2
output:
2.00000000000000000000 4.00000000000000000000
result:
wrong answer 1st numbers differ - expected: '4.0000000', found: '2.0000000', error = '0.5000000'