답안 #858373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
858373 2023-10-08T09:18:23 Z votranngocvy 평균 (COCI14_prosjek) C++14
50 / 50
1 ms 600 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
const int N = 100 + 5;
ll a[N],b[N];

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> b[i];
    a[1] = b[1];
    ll sum = a[1];
    for (int i = 2; i <= n; i++) {
        a[i] = b[i] * i - sum;
        sum += a[i];
    }
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << "\n";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 600 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 460 KB Output is correct
10 Correct 0 ms 348 KB Output is correct