#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
const int mxN = 1e5, M = 1e9+7;
int main(){
#ifdef _DEBUG
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif
std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
int n;
cin >> n;
vector<int> b(n), ans(n);
ll sum = 0;
for(int i = 0; i<n; ++i){
cin >> b[i];
}
for(int i = 0; i<n; ++i){
ans[i] = b[i]*(i+1)-sum;
sum += ans[i];
}
for(int i = 0; i<n; ++i){
cout << ans[i] << " ";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
312 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 |