QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#261887 | #6397. Master of Both III | Ycfhnnd | WA | 1ms | 3748kb | C++20 | 690b | 2023-11-23 12:52:56 | 2023-11-23 12:52:56 |
Judging History
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