# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
208845 | teomrn | Werewolf (IOI18_werewolf) | C++14 | 1355 ms | 122664 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 Aib {
vector <int> aib;
function <int(int)> lsb = [](int x) { return x & (-x); };
function <int(int)> qry = [&](int p) {
int ans = 0;
while (p)
ans += aib[p], p -= lsb(p);
return ans;
};
Aib(int N) : aib(N + 2, 0) { }
void Update(int poz, int val)
{
poz++;
while (poz < (int)aib.size())
aib[poz] += val, poz += lsb(poz);
}
int Query(int st, int dr)
{
st++, dr++;
return qry(dr) - (st > 0 ? qry(st - 1) : 0);
}
};
struct Tree {
# | 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... |