QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#699631 | #5304. Money Game | tsogsummit# | WA | 0ms | 3960kb | C++14 | 852b | 2024-11-02 10:11:18 | 2024-11-02 10:11:19 |
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("%.9Lf " , k * 2.0);
else printf("%.9Lf " , k);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3960kb
input:
2 4 2
output:
4.000000000 2.000000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3920kb
input:
2 2 3
output:
3.333333333 1.666666667
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
2 851648 722281
output:
1049286.000000000 524643.000000000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
3 450762 114467 367746
output:
466487.500000000 233243.750000000 233243.750000000
result:
ok 3 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
4 2 3 5 1
output:
4.400000000 2.200000000 2.200000000 2.200000000
result:
ok 4 numbers
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3864kb
input:
5 616288 155735 783782 648639 349827
output:
425711.833333333 851423.666666667 425711.833333333 425711.833333333 425711.833333333
result:
wrong answer 1st numbers differ - expected: '851423.6666667', found: '425711.8333333', error = '0.5000000'