Submission #1264830

#TimeUsernameProblemLanguageResultExecution timeMemory
1264830ngunguoi45평균 (COCI14_prosjek)C++17
50 / 50
0 ms328 KiB
#include <bits/stdc++.h>
#define add emplace_back
#define fi first
#define se second

using namespace std;
using ll = long long;
using pll = pair<ll,ll>;
using pii = pair<int,int>;

const int maxn = 105;
int n;
ll a[maxn], b[maxn];

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    cin >> n;
    for (int i = 1;i <= n; i++) {
        cin >> b[i];
    }
    for (int i = 1;i <= n; i++) {
        a[i] = 1LL*b[i] * i - 1LL*b[i-1] * (i-1);
        cout << a[i] << " ";
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...