QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90148#5304. Money GameChatGPTWA 0ms3612kbC++601b2023-03-22 13:47:052023-03-22 13:47:06

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-22 13:47:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2023-03-22 13:47:05]
  • 提交

answer

#include <cmath>
#include <iostream>
#include <vector>
using namespace std;

int main() {
    int n;
    cin >> n;

    // read the initial deposits
    vector<double> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    // calculate the final deposits
    vector<double> b(n);
    for (int i = 0; i < n; i++) {
        b[i] = a[i] * pow(0.5, 20221204);
        if (i > 0) b[i] += b[i-1];
    }
    b[0] += b[n-1];

    // output the final deposits
    for (int i = 0; i < n; i++) {
        cout << b[i] << " ";
    }
    cout << endl;

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
4 2

output:

0 0 

result:

wrong answer 1st numbers differ - expected: '4.0000000', found: '0.0000000', error = '1.0000000'