# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
868041 | vjudge1 | Werewolf (IOI18_werewolf) | C++17 | 1873 ms | 226088 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 "werewolf.h"
using namespace std;
#include <bits/stdc++.h>
class tree_t {
public:
int N, timer;
vector<int> tin, tout, a;
vector<vector<int>> g, par;
tree_t(int N = 0) : N(N), tin(N), tout(N), g(N), timer(0), a(N), par(__lg(N) + 1, vector<int>(N)) {}
void dfs(int u, int p) {
tin[u] = timer++;
par[0][u] = p;
for (int i = 1; i <= __lg(N); i++) par[i][u] = par[i - 1][par[i - 1][u]];
for (int v : g[u]) dfs(v, u);
tout[u] = timer;
}
};
class segtree_t {
public:
segtree_t *left, *right;
vector<int> val;
int l, r, m;
segtree_t(int l, int r) : l(l), r(r), m(l + r >> 1), val() {
if (l == r) return;
left = new segtree_t(l, m);
right = new segtree_t(m + 1, r);
Compilation message (stderr)
# | 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... |