# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
139947 | mosesmayer | 늑대인간 (IOI18_werewolf) | C++17 | 624 ms | 61960 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |