# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1264730 | lemoncat | Prosjek (COCI14_prosjek) | C++20 | 0 ms | 468 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n, a[200005], b[200005];
vector<int> v;
signed main() {
cin >> n;
for (int i = 1; i <= n; i++) cin >> b[i];
for (int i = 1; i <= n; i++) {
a[i] = i * b[i];
for (auto k : v) {
a[i] -= k;
}
v.push_back(a[i]);
}
for (int i = 1; i <= n; i++) cout << a[i] << " ";
cout << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |