# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
145966 | 2019-08-21T13:13:27 Z | grobar | 평균 (COCI14_prosjek) | C++14 | 2 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=1;i<=n;i++) { cin>>a[i]; } vector<int>v; v.push_back(a[1]); int sum=a[1]; for(int i=2;i<=n;i++) { v.push_back(i*a[i]-sum); sum=sum+i*a[i]-sum; } for(int i=0;i<v.size();i++) { cout<<v[i]<<endl; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |