# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
729755 | Winter | Prosjek (COCI14_prosjek) | C++17 | 1 ms | 320 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 <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2")
int main(){
ios_base::sync_with_stdio(false); cin.tie(NULL);
ll n; cin >> n; vector<ll> v(n);
for(ll i = 0; i<n; i++){
cin >> v[i];
}
vector<ll> ans; ans.pb(v[0]);
ll sum=v[0];
for(ll i = 1; i<n; i++){
ans.pb(((i+1)*v[i])-sum); sum+=ans[i];
}
for(ll i = 0; i<n; i++) cout << ans[i] << " ";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |