# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
81630 | 2018-10-25T16:07:12 Z | xiaowuc1 | Prosjek (COCI14_prosjek) | C++14 | 2 ms | 708 KB |
#include <bits/stdc++.h> /* unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count(); mt19937 g1.seed(seed1); ios_base::sync_with_stdio(false); cin.tie(NULL); */ using namespace std; const double PI = 2 * acos(0); typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<int, ll> pill; typedef pair<ll, ll> pll; typedef long double ld; typedef vector<vector<ll>> matrix; ll l[105]; ll ret[105]; int n; int main() { scanf("%d", &n); for(int i = 1; i <= n; i++) { scanf("%lld", &l[i]); } ret[1] = l[1]; for(int i = 2; i <= n; i++) { ret[i] = l[i] * i; for(int a = 1; a < i; a++) { ret[i] -= ret[a]; } } for(int i = 1; i <= n; i++) { printf("%lld", ret[i]); if(i == n) printf("\n"); else printf(" "); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 404 KB | Output is correct |
3 | Correct | 2 ms | 432 KB | Output is correct |
4 | Correct | 2 ms | 496 KB | Output is correct |
5 | Correct | 2 ms | 556 KB | Output is correct |
6 | Correct | 2 ms | 556 KB | Output is correct |
7 | Correct | 2 ms | 708 KB | Output is correct |
8 | Correct | 2 ms | 708 KB | Output is correct |
9 | Correct | 2 ms | 708 KB | Output is correct |
10 | Correct | 2 ms | 708 KB | Output is correct |