QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#656789 | #5304. Money Game | iliyian# | WA | 1ms | 4040kb | C++23 | 745b | 2024-10-19 13:42:18 | 2024-10-19 13:42:19 |
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);
int sum = 0;
for (int i = 1; i <= n; i++) {
std::cin >> a[i];
sum += a[i];
}
double t = (double)sum / (n + 1);
int pos = qpow(2022, 1204, n);
for (int i = 1; i <= n; i++) {
std::cout << std::fixed << std::setprecision(20) << t * (pos == i - 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: 100
Accepted
time: 1ms
memory: 3868kb
input:
2 4 2
output:
4.00000000000000000000 2.00000000000000000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 4040kb
input:
2 2 3
output:
3.33333333333333348136 1.66666666666666674068
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 4036kb
input:
2 851648 722281
output:
1049286.00000000000000000000 524643.00000000000000000000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3972kb
input:
3 450762 114467 367746
output:
466487.50000000000000000000 233243.75000000000000000000 233243.75000000000000000000
result:
ok 3 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
4 2 3 5 1
output:
4.40000000000000035527 2.20000000000000017764 2.20000000000000017764 2.20000000000000017764
result:
ok 4 numbers
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3816kb
input:
5 616288 155735 783782 648639 349827
output:
425711.83333333331393077970 851423.66666666662786155939 425711.83333333331393077970 425711.83333333331393077970 425711.83333333331393077970
result:
wrong answer 1st numbers differ - expected: '851423.6666667', found: '425711.8333333', error = '0.5000000'