# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
854080 | The_Samurai | Money (IZhO17_money) | C++17 | 118 ms | 15224 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;
using ll = long long;
const int inf = 1e9;
const int N = 1e6 + 5;
struct SegTree {
vector<int> tree;
int size;
void init(int n) {
size = 1;
while (size < n) size <<= 1;
tree.assign(2 * size, 0);
}
void update(int i, int v, int x, int l, int r) {
if (r - l == 1) {
tree[x] += v;
return;
}
int m = (l + r) >> 1;
if (i < m) update(i, v, x << 1, l, m);
else update(i, v, x << 1 | 1, m, r);
tree[x] = tree[x << 1] + tree[x << 1 | 1];
}
void update(int i, int v) {
assert(i < size);
update(i, v, 1, 0, size);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |