# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1064480 | MisterReaper | Street Lamps (APIO19_street_lamps) | C++17 | 861 ms | 67292 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.
// File C.cpp created on 18.08.2024 at 15:17:15
#include <bits/stdc++.h>
using i64 = long long;
#ifdef DEBUG
#include "../debug.h"
#else
#define debug(...) void(23)
#endif
constexpr int maxN = 3E5 + 5;
int lsb(int x) {
return x & -x;
}
struct fenwick {
int n;
std::vector<i64> tree;
std::vector<std::pair<int, int>> his;
fenwick(int _n) : n(_n), tree(n + 1) {}
void modify(int p, int x, bool flag = true) {
if(flag) his.emplace_back(p, x);
for(p += 1; p <= n; p += lsb(p)) {
tree[p] += x;
}
}
i64 query(int p) {
i64 res = 0;
for(p += 1; p; p -= lsb(p)) {
# | 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... |