Submission #31890

# Submission time Handle Problem Language Result Execution time Memory
31890 2017-09-12T05:42:21 Z 5ak0 Prosjek (COCI14_prosjek) C++14
50 / 50
0 ms 2176 KB
/*
ID: 5ak0
PROG:
LANG: C++11
*/

#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define mpr make_pair

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;

int x, n;

int main(){
    #ifndef SAKO
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);
    #endif // SAKO
    ios_base::sync_with_stdio(0);

    cin >> n;
    ll last = 0;
    for (int i = 1; i <= n; ++i){
        cin >> x;
        ll sum = (ll)x * i;
        cout << sum - last << " ";
        last = sum;
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 2176 KB Output is correct
2 Correct 0 ms 2176 KB Output is correct
3 Correct 0 ms 2176 KB Output is correct
4 Correct 0 ms 2176 KB Output is correct
5 Correct 0 ms 2176 KB Output is correct
6 Correct 0 ms 2176 KB Output is correct
7 Correct 0 ms 2176 KB Output is correct
8 Correct 0 ms 2176 KB Output is correct
9 Correct 0 ms 2176 KB Output is correct
10 Correct 0 ms 2176 KB Output is correct