# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
233743 | DodgeBallMan | Prosjek (COCI14_prosjek) | C++14 | 5 ms | 384 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;
const int N = 110;
int n, a[N], sum[N];
int main()
{
scanf("%d",&n);
for( int i = 1 ; i <= n ; i++ ) scanf("%d",&a[i]);
for( int i = 1 ; i <= n ; i++ ) {
a[i] = a[i] * i - sum[i-1];
sum[i] = sum[i-1] + a[i];
}
for( int i = 1 ; i <= n ; i++ ) printf("%d ",a[i]);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |