QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#90148 | #5304. Money Game | ChatGPT | WA | 0ms | 3612kb | C++ | 601b | 2023-03-22 13:47:05 | 2023-03-22 13:47:06 |
Judging History
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'