QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#218388 | #5304. Money Game | haze | WA | 0ms | 3912kb | C++20 | 1.4kb | 2023-10-18 09:53:29 | 2023-10-18 09:53:29 |
Judging History
answer
#include<bits/stdc++.h>
#define irep(i,l,r) for(int (i) = (l); (i) <= (r); ++(i))
#define drep(i,r,l) for(int (i) = (r); (i) >= (l); --(i))
#define ceil(pp,qq) (((pp)>0)^((qq)>0)?-abs(pp)/abs(qq):(pp)%(qq)?(pp)/(qq)+1:(pp)/(qq))
#define floor(pp,qq) (((pp)>0)^((qq)>0)?-ceil(abs(pp),abs(qq)):(pp)/(qq))
#define ll long long
#define LL __int128
using namespace std;
inline ll read(){
char ch = getchar();
ll s = 0; bool w = 0;
while(!isdigit(ch)){if(ch == '-')w = 1;ch = getchar();}
while(isdigit(ch))s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
return w ? - s : s;
}
inline char rc(){
char ch = getchar();
while(1){
if(ch >= 'A' && ch <= 'Z')return ch;
if(ch >= 'a' && ch <= 'z')return ch;
ch = getchar();
}
}
template<class T1, class T2>
T1 min(T1 AA, T2 BB){return AA > BB ? BB : AA;}
template<class T1, class T2>
T1 max(T1 AA, T2 BB){return AA < BB ? BB : AA;}
const int itinf = 1e9;
const ll llinf = 4e18;
//const int mod = 1000000007;
const int N = 500009;
ll qpow(ll base, ll b, ll mod){
ll ans = 1;
while(b){
if(b & 1)ans *= base, ans %= mod;
base *= base, base %= mod, b >>= 1;
}
return ans;
}
int main(){
int n = read();
ll sum = 0;
irep(i,0,n -1 )sum += read();
double per = 1.00 * sum / (n + 1);
int pos = qpow(2022, 1204, n);
irep(i, 0, n - 1){
if(i == pos)printf("%0.12lf ",per * 2);
else printf("%0.12lf ", per);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3912kb
input:
2 4 2
output:
4.000000000000 2.000000000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
2 2 3
output:
3.333333333333 1.666666666667
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
2 851648 722281
output:
1049286.000000000000 524643.000000000000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
3 450762 114467 367746
output:
466487.500000000000 233243.750000000000 233243.750000000000
result:
ok 3 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
4 2 3 5 1
output:
4.400000000000 2.200000000000 2.200000000000 2.200000000000
result:
ok 4 numbers
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3880kb
input:
5 616288 155735 783782 648639 349827
output:
425711.833333333314 851423.666666666628 425711.833333333314 425711.833333333314 425711.833333333314
result:
wrong answer 1st numbers differ - expected: '851423.6666667', found: '425711.8333333', error = '0.5000000'