QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#722099#5304. Money GamePoonYaPatWA 0ms3904kbC++14568b2024-11-07 17:49:272024-11-07 17:49:27

Judging History

你现在查看的是最新测评结果

  • [2024-11-07 17:49:27]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3904kb
  • [2024-11-07 17:49:27]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll mod;

ll binpow(ll a, ll n) {
    ll ans=1;
    while (n) {
        if (n%2==1) ans=(ans*a)%mod;
        a=(a*a)%mod;
        n/=2;
    }
    return ans;
}

int main() {
    int n; cin>>n;
    mod=n;
    double sum=0,a[n+5];
    for (int i=0; i<n; ++i) cin>>a[i], sum+=a[i];

    int x=binpow(2022,1204);

    for (int i=0; i<n; ++i) {
        if (i==x) cout<<fixed<<setprecision(8)<<sum*2/(n+1)<<" ";
        else cout<<fixed<<setprecision(8)<<sum/(n+1)<<" ";
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3904kb

input:

2
4 2

output:

4.00000000 2.00000000 

result:

ok 2 numbers

Test #2:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

2
2 3

output:

3.33333333 1.66666667 

result:

ok 2 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

2
851648 722281

output:

1049286.00000000 524643.00000000 

result:

ok 2 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

3
450762 114467 367746

output:

466487.50000000 233243.75000000 233243.75000000 

result:

ok 3 numbers

Test #5:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

4
2 3 5 1

output:

4.40000000 2.20000000 2.20000000 2.20000000 

result:

ok 4 numbers

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3664kb

input:

5
616288 155735 783782 648639 349827

output:

425711.83333333 851423.66666667 425711.83333333 425711.83333333 425711.83333333 

result:

wrong answer 1st numbers differ - expected: '851423.6666667', found: '425711.8333333', error = '0.5000000'