# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
892261 | tch1cherin | 가로등 (APIO19_street_lamps) | C++17 | 1835 ms | 109496 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;
struct fenwick {
int size;
vector<int> tree;
int sum;
vector<int> updates;
fenwick() {}
fenwick(int n) : size(n), tree(n + 1), sum(0) {}
void update(int i, int v) {
sum += v;
for (i++; i <= size; i += i & -i) {
updates.push_back(i);
tree[i] += v;
}
}
int prefix_query(int r) {
int ans = 0;
for (; r > 0; r -= r & -r) {
ans += tree[r];
}
return ans;
}
int suffix_query(int l) {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |