Submission #738503

# Submission time Handle Problem Language Result Execution time Memory
738503 2023-05-09T00:41:21 Z mzv Prosjek (COCI14_prosjek) C++17
50 / 50
1 ms 336 KB
#include <bits/stdc++.h>

#define ccd ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define endl '\n'

using namespace std;

/* ------------------------ hi lol ------------------------ */

int n;
ll num,ans,sum=0;

int main() {
    ccd
    cin >> n;
    for (int nm=1;nm<=n;nm++) {
    	cin >> num;
    	ans = (num*nm)-sum;
    //	cout << nm << " " << num << " " << sum << " " << ans << endl;
    	cout << ans;
    	if (nm<n) cout << " ";
    	sum+=ans;
    }
    cout << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 316 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 1 ms 320 KB Output is correct
7 Correct 0 ms 316 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 316 KB Output is correct