QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#699565 | #5304. Money Game | tsogsummit# | WA | 0ms | 3988kb | C++14 | 885b | 2024-11-02 09:55:47 | 2024-11-02 09:55:47 |
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;
res %= mod;
while(b > 0) {
if(b & 1){
res = res * a;
res %= mod;
}
a = a * a;
a %= mod;
b >>= 1;
}
return res;
}
int main(){
int n , i;
cin >> n;
long double a;
long double b[n];
long double sum = 0 ;
for(i = 0 ; i < n ; i ++){
cin >> a;
sum += a;
}
long double k = sum * 1.0 / (n + 1);
int uld = binpow(2012 , 1204 , n);
for(i = 0 ; i < n ; i++){
cout << fixed;
if(i == uld) printf("%6Lf " , k * 2.0);
else printf("%6Lf " , k);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3976kb
input:
2 4 2
output:
4.000000 2.000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3988kb
input:
2 2 3
output:
3.333333 1.666667
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3880kb
input:
2 851648 722281
output:
1049286.000000 524643.000000
result:
ok 2 numbers
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3916kb
input:
3 450762 114467 367746
output:
233243.750000 466487.500000 233243.750000
result:
wrong answer 1st numbers differ - expected: '466487.5000000', found: '233243.7500000', error = '0.5000000'