QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#279509#5304. Money Gamezzuqy#WA 1ms3740kbC++20940b2023-12-08 20:23:462023-12-08 20:23:46

Judging History

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

  • [2023-12-08 20:23:46]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3740kb
  • [2023-12-08 20:23:46]
  • 提交

answer

#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <stack>
#include <vector>
#include <algorithm>
#include <queue>
#include <bitset>
using namespace std;
const int N = 1e5 +9 ;
typedef long long ll;
int read() {
  int x = 0, s = 1; char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) if (ch == '-') s = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ 48);
  return x * s; 
}

int n;
double a[N];

int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  double sum = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  // for (int j = 0; j < 1000; ++j) {
  //   for (int i = 1; i <= n; ++i) {
  //     a[(i % n) + 1] += a[i] / 2;
  //     a[i] /= 2;
  //   }
  // }
  cout << sum / (n + 1) * 2 << ' ';
  for (int i = 2; i <= n; ++i) {
    cout << sum / (n + 1) << ' ';
  }
  cout << '\n';
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3648kb

input:

2
4 2

output:

4 2 

result:

ok 2 numbers

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3740kb

input:

2
2 3

output:

3.33333 1.66667 

result:

wrong answer 2nd numbers differ - expected: '1.6666667', found: '1.6666700', error = '0.0000020'