# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
189134 | AlexPop28 | Street Lamps (APIO19_street_lamps) | C++11 | 2992 ms | 172412 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 dbg() cerr <<
#define name(x) (#x) << ": " << (x) << ' ' <<
using namespace std;
struct Fenwick {
int n;
vector<int> tree;
Fenwick(int n_ = 0) : n(n_), tree(n + 1) {}
inline int lsb(int x) {
return x & -x;
}
void Update(int pos, int val) {
for (++pos; pos <= n; pos += lsb(pos))
tree[pos] += val;
}
void Update(int left, int right, int val) {
Update(left, val);
Update(right + 1, -val);
}
int Query(int pos) {
int ans = 0;
for (++pos; pos; pos -= lsb(pos))
ans += tree[pos];
return ans;
}
};
struct SegmTree {
# | 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... |