# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
477831 | chungdinh | Prosjek (COCI14_prosjek) | C++14 | 1 ms | 208 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <bitset>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define ii pair<int,int>
#define pll pair<long long, long long>
#define fi first
#define se second
#define r first
#define c second
#define all(x) x.begin(), x.end()
ostream& operator << (ostream& os, pair<int, int> a) {
return os << a.first << " : " << a.second;
}
#define endl '\n'
#define db(val) "["#val" = "<<(val)<<"] "
#define cntbit(x) __builtin_popcount(x)
const int N = 3e5 + 5;
const int iINF = 1e9;
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1e18;
int n;
int main() {
#ifdef CHUNGDINH
freopen("main.inp","r",stdin);
//freopen("main.out","w",stdout);
#endif
cin >> n;
ll sum = 0;
for (int i = 1; i <= n; i++) {
ll tt; cin >> tt;
ll cur;
if (i == 1) cur = tt;
else cur = tt * i - sum;
cout << cur << " ";
sum += cur;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |