# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1036384 | kebine | Addk (eJOI21_addk) | C++17 | 25 ms | 4436 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>
#define int long long
using namespace std;
const int maxn = 1e5;
int n, k, q, a[maxn+5], pref[maxn+5], pos[15], pre[maxn+5], suf[maxn+5];
signed main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin >> n >> k;
for (int i=1; i<=n; i++) {
cin >> a[i];
}
pref[0] = pre[0] = suf[n+1] = 0;
for (int i=1; i<=n; i++) {
pref[i] = pref[i-1] + a[i];
pre[i] = pre[i-1] + a[i] * i;
suf[n-i+1] = suf[n-i+2] + a[n-i+1] * i;
}
cin >> q;
while (q--) {
int t;
cin >> t;
if (t == 1) {
for (int i=1; i<=k; i++) {
cin >> pos[i];
}
continue; // subtask 1, 2
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |