# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
86265 | MohamedAhmed0 | Prosjek (COCI14_prosjek) | C++14 | 2 ms | 544 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.
/* Author : Mohamed Ahmed
Just solution will be average * index - (sum of elements before it)
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n ;
cin>>n ;
long long sum = 0 ;
for(int i = 1 ; i <= n ; ++i)
{
long long x ;
cin>>x ;
long long a = x * (i*1ll) - sum ;
cout<<a<<" ";
sum += a ;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |