# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
630108 | ZsofiaKeresztely | Addk (eJOI21_addk) | C++14 | 1246 ms | 9652 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;
typedef long long ll;
vector<ll> lstairs, rstairs, pref;
ll n;
void upd(vector<ll> &a){
pref.assign(n+1, 0);
lstairs.assign(n+1, 0);
rstairs.assign(n+1, 0);
for (ll i=1; i<n+1; i++){
pref[i] = pref[i-1] + a[i];
lstairs[i] = lstairs[i-1] + pref[i];
}
rstairs[n] = a[n];
for (ll i=n-1; i>0; i--){
rstairs[i] = rstairs[i+1] + (pref[n] - pref[i-1]);
}
return;
}
int main(){
ll k;
cin >> n >> k;
vector<ll> a(n+1);
vector<ll> orig;
for (ll i=1; i<n+1; i++){
cin >> a[i];
}
orig = a;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |