Submission #396585

# Submission time Handle Problem Language Result Execution time Memory
396585 2021-04-30T11:02:09 Z mewnian Prosjek (COCI14_prosjek) C++17
50 / 50
1 ms 320 KB
#include <bits/stdc++.h>
#define sze(x) (ll)x.size()
#define idx(x, a) get<x>(a)
#define pb push_back
#define fi first
#define se second

using namespace std;

typedef long long ll;

const ll MAXN = 103;

ll a[MAXN], b[MAXN], n;

int main()
{
    ios_base::sync_with_stdio(0); cout.tie(0);
    #ifdef OFFLINE
    freopen("input.inp", "r", stdin);
    #endif
    cin >> n;
    for (ll i = 0; i < n; ++i) cin >> b[i];
    ll sum = 0;
    for (ll i = 0; i < n; sum += a[i++])
    {
        a[i] = b[i] * (i + 1) - sum;
        cout << a[i] << ' ';
    }
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 312 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 320 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct