#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
vector<int> b;
vector<int> a;
cin >> n;
for (int i=0; i<n; i++) {
int c;
cin >> c;
b.push_back(c);
}
a.push_back(b[0]);
int media=a[0];
for (int nums=1; nums<n; nums++) {
a.push_back(b[nums]*(nums+1)-media);
media += a[nums];
}
for (int i=0; i<n; i++) {
cout << a[i];
if (i!=(n-1)) {
cout << " ";
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
316 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
316 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 |