QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#699595#5304. Money Gametsogsummit#WA 0ms4036kbC++14870b2024-11-02 10:02:402024-11-02 10:02:41

Judging History

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

  • [2024-11-02 10:02:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4036kb
  • [2024-11-02 10:02:40]
  • 提交

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;

    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(2022 , 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: 3868kb

input:

2
4 2

output:

4.000000 2.000000 

result:

ok 2 numbers

Test #2:

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

input:

2
2 3

output:

3.333333 1.666667 

result:

ok 2 numbers

Test #3:

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

input:

2
851648 722281

output:

1049286.000000 524643.000000 

result:

ok 2 numbers

Test #4:

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

input:

3
450762 114467 367746

output:

466487.500000 233243.750000 233243.750000 

result:

ok 3 numbers

Test #5:

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

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: 3916kb

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'