QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#261887#6397. Master of Both IIIYcfhnndWA 1ms3748kbC++20690b2023-11-23 12:52:562023-11-23 12:52:56

Judging History

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

  • [2023-11-23 12:52:56]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3748kb
  • [2023-11-23 12:52:56]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve(){
    int n;
    cin >> n;
    vector<double>a(n);
    for (int i = 0;i < n;i ++ ){
        cin >> a[i];
    }
    i64 sum = accumulate(a.begin(), a.end(), 0LL);
    double w = 1.0 * sum / (n + 1);

    for (int i = 1;i <= n;i ++){
        if(i == 1){
            cout << fixed << setprecision(10) << w * 2 << " ";
        }else{
            cout << fixed << setprecision(10) << w  << " ";
        }
    }
}   

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);  

    int T = 1;
    // cin >> T;
    while (T --){
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3748kb

input:

3
2 1 2

output:

2.5000000000 1.2500000000 1.2500000000 

result:

wrong output format Expected integer, but "2.5000000000" found