Submission #163211

# Submission time Handle Problem Language Result Execution time Memory
163211 2019-11-11T19:43:04 Z beso123 Prosjek (COCI14_prosjek) C++14
50 / 50
2 ms 384 KB
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,a[105];
main(){
cin>>n;
for(int k=1;k<=n;k++)
    cin>>a[k];
int sum=a[1];
cout<<a[1]<<' ';
for(int k=2;k<=n;k++){
    int h=a[k]*k-sum;
    sum+=h;
    cout<<h<<' ';
}
return 0;
}

Compilation message

prosjek.cpp:5:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 1 ms 376 KB Output is correct
7 Correct 2 ms 380 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct