QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#656860#5304. Money Gameiliyian#WA 0ms3928kbC++231.0kb2024-10-19 13:47:342024-10-19 13:47:35

Judging History

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

  • [2024-10-19 13:47:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3928kb
  • [2024-10-19 13:47:34]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long

int qpow(int a, int b, int mod) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}

void solve() {
  int n;
  std::cin >> n;
  std::vector<int> a(n + 1);
  std::vector<double> ans(n + 1);
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    std::cin >> a[i];
    sum += a[i];
    ans[i] = a[i];
  }
  // for (int t = 1; t <= 10000; t++) {
  //   int p = t % n + 1;
  //   ans[p % n + 1] += ans[p] / 2;
  //   ans[p] /= 2;
  // }
  // for (int i = 1; i <= n; i++) {
  //   std::cout << ans[i] << ' ';
  // }
  // // return;
  double t = (double)sum / (n + 1);
  int pos = qpow(2022, 1204, n);
  pos++;
  for (int i = 1; i <= n; i++) {
    std::cout << std::fixed << std::setprecision(20) << t * (i == (n - pos + 1) ? 2 : 1) << ' ';
  }
  std::cout << '\n';
}

signed main() {
  std::cin.tie(nullptr)->sync_with_stdio(false);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3928kb

input:

2
4 2

output:

2.00000000000000000000 4.00000000000000000000 

result:

wrong answer 1st numbers differ - expected: '4.0000000', found: '2.0000000', error = '0.5000000'