QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#699620 | #5304. Money Game | tsogsummit# | WA | 0ms | 3976kb | C++14 | 848b | 2024-11-02 10:09:15 | 2024-11-02 10:09:16 |
Judging History
answer
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#define ll long long
#define F first
#define S second
#define pb push_back
#define mp make_pair
using namespace std;
ll binpow(ll a, ll b , int mod) {
ll res = 1;
a %= mod;
while(b > 0) {
if(b & 1){
res = res * a;
res %= mod;
}
a = a * a;
a %= mod;
b >>= 1;
}
return res % mod;
}
int main(){
long long n , i;
cin >> n;
long long a;
long long sum = 0 ;
for(i = 0 ; i < n ; i ++){
cin >> a;
sum += a;
}
long double k = sum * 1.0 / (n + 1);
long long uld = binpow(2022 , 1204 , n);
for(i = 0 ; i < n ; i++){
if(i == uld) printf("%Lf " , k * 2.0);
else printf("%Lf " , k);
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3912kb
input:
2 4 2
output:
4.000000 2.000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
2 2 3
output:
3.333333 1.666667
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
2 851648 722281
output:
1049286.000000 524643.000000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
3 450762 114467 367746
output:
466487.500000 233243.750000 233243.750000
result:
ok 3 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
4 2 3 5 1
output:
4.400000 2.200000 2.200000 2.200000
result:
ok 4 numbers
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3976kb
input:
5 616288 155735 783782 648639 349827
output:
425711.833333 851423.666667 425711.833333 425711.833333 425711.833333
result:
wrong answer 1st numbers differ - expected: '851423.6666667', found: '425711.8333330', error = '0.5000000'