QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#656931#5304. Money Gameiliyian#WA 1ms3912kbC++231021b2024-10-19 13:52:562024-10-19 13:53:02

Judging History

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

  • [2024-10-19 13:53:02]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3912kb
  • [2024-10-19 13:52:56]
  • 提交

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 - 1) % 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 += 2;
  for (int i = 1; i <= n; i++) {
    std::cout << std::fixed << std::setprecision(20) << t * (i == pos ? 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: 1ms
memory: 3912kb

input:

2
4 2

output:

4 2 2.00000000000000000000 4.00000000000000000000 

result:

wrong output format Extra information in the output file