# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
622467 | pakapu | Addk (eJOI21_addk) | C++14 | 1284 ms | 3972 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.
#pragma GCC optimize ("O3")
#include <iostream>
#include <vector>
using namespace std;
long long tree[131071 * 2 - 1];
int sz;
void init(int n) {
sz = 1 << (32 - __builtin_clz(n - 1));
}
void set(int pos, int val, int x, int lx, int rx) {
if(rx - lx == 1) {
tree[x] = val;
return;
}
int mid = (lx + rx) / 2;
if(pos >= mid) {
set(pos, val, x * 2 + 2, mid, rx);
}
else {
set(pos, val, x * 2 + 1, lx, mid);
}
tree[x] = tree[x * 2 + 1] + tree[x * 2 + 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... |