# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
139947 | mosesmayer | Werewolf (IOI18_werewolf) | C++17 | 624 ms | 61960 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"
#include <bits/stdc++.h>
#define eb emplace_back
using namespace std;
typedef vector<int> vi;
const int MX = 2e5;
int spt_mn[19][MX + 5];
int spt_mx[19][MX + 5];
int vals[MX + 5];
int n, m;
vi adj[MX + 5];
int flat[MX + 5], in[MX + 5], lg[MX + 5];
void dfs(int u, int prv = 0){
static int tme = 0;
in[u] = ++tme;
flat[tme] = u;
vals[tme] = u;
for (int nx : adj[u]){
if (nx != prv) dfs(nx, u);
}
}
void computeSparseTable(){
int st = 1;
for (; adj[st].size() != 1; st++);
dfs(st);
lg[1] = 0;
for (int j = 1; j <= n; j++){
spt_mn[0][j] = spt_mx[0][j] = vals[j];
# | 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... |