QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#656931 | #5304. Money Game | iliyian# | WA | 1ms | 3912kb | C++23 | 1021b | 2024-10-19 13:52:56 | 2024-10-19 13:53:02 |
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 - 1) % 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 += 2;
for (int i = 1; i <= n; i++) {
std::cout << std::fixed << std::setprecision(20) << t * (i == pos ? 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: 1ms
memory: 3912kb
input:
2 4 2
output:
4 2 2.00000000000000000000 4.00000000000000000000
result:
wrong output format Extra information in the output file