# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
858373 | votranngocvy | Prosjek (COCI14_prosjek) | C++14 | 1 ms | 600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 100 + 5;
ll a[N],b[N];
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n;
cin >> n;
for (int i = 1; i <= n; i++) cin >> b[i];
a[1] = b[1];
ll sum = a[1];
for (int i = 2; i <= n; i++) {
a[i] = b[i] * i - sum;
sum += a[i];
}
for (int i = 1; i <= n; i++) cout << a[i] << " ";
cout << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |