# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
824989 | phoenix | Werewolf (IOI18_werewolf) | C++17 | 522 ms | 87852 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>
#include "werewolf.h"
using namespace std;
struct SegTree {
const static int N = (1 << 18);
vector<int> t;
SegTree() {
t.assign(2 * N, -1);
}
void update(int pos, int val) {
for(t[pos += N] = val; pos > 1; pos >>= 1) {
t[pos >> 1] = max(t[pos], t[(pos ^ 1)]);
}
}
int get(int ql, int qr) {
int res = -1;
for(ql += N, qr += N + 1; ql < qr; ql >>= 1, qr >>= 1) {
if(ql & 1) res = max(t[ql++], res);
if(qr & 1) res = max(t[--qr], res);
}
return res;
}
};
struct DSU {
vector<int> p, r;
DSU(int n) {
p.assign(n, 0);
# | 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... |