#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int n;
cin >> n;
int a[n + 1], b[n + 1];
b[0] = 0;
for (int i = 1; i <= n; i++){
cin >> a[i];
b[i] = a[i] * i;
cout << b[i] - b[i - 1] << " ";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
504 KB |
Output is correct |
2 |
Correct |
3 ms |
504 KB |
Output is correct |
3 |
Correct |
3 ms |
544 KB |
Output is correct |
4 |
Correct |
2 ms |
544 KB |
Output is correct |
5 |
Correct |
2 ms |
584 KB |
Output is correct |
6 |
Correct |
3 ms |
640 KB |
Output is correct |
7 |
Correct |
3 ms |
700 KB |
Output is correct |
8 |
Correct |
3 ms |
700 KB |
Output is correct |
9 |
Correct |
2 ms |
700 KB |
Output is correct |
10 |
Correct |
2 ms |
700 KB |
Output is correct |