# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
76581 | Xylofo | Werewolf (IOI18_werewolf) | C++14 | 1886 ms | 235564 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = a; i < b; ++i)
using vi = vector<int>;
using graph = vector<vi>;
const int LG = 28;
struct Tree {
graph t;
vi p;
vector<vi> fastUp;
int fd(int a) { return p[a] == a ? a : p[a] = fd(p[a]); }
int n;
vi start, end, fromP;
int root;
Tree(int rev, const graph &g) {
n = g.size();
t.resize(n);
fastUp.assign(n, vi(LG,-1));
p.resize(n);
fromP = start = end = p;
rep(i,0,n) p[i] = i;
for(int i = rev*(n-1); i >= 0 && i < n; i += 1 - 2*rev) {
for(int j:g[i]) if(rev ^ (j < i)) {
int jj = fd(j);
if(jj != i) {
p[jj] = i;
t[i].push_back(jj);
컴파일 시 표준 에러 (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... |