# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1042033 | Dan4Life | Werewolf (IOI18_werewolf) | C++17 | 4065 ms | 92076 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>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
using vi = vector<int>;
using ll = long long;
using ar2 = array<int,2>;
const int mxN = (int)2e5+10;
const int mxLg = 20;
int n,m,q,dfs_timer;
int jmp[2][mxLg][mxN];
int st[2][mxN], en[2][mxN], A[2][mxN];
vector<int> adj[mxN], euler[2], adj2[2][mxN];
template<int SZ> struct DSU{
int p[SZ], root;
void init(int n){ for(int i=0; i<n; i++) p[i]=i;}
int findSet(int i){return p[i]==i?i:p[i]=findSet(p[i]);}
bool isSameSet(int i, int j) {return findSet(i)==findSet(j);}
void unionSet(int t, int i, int j){
int x = findSet(i), y = findSet(j);
if(x==y) return;
adj2[t][x].pb(y); root=x, p[y]=x;
}
};
DSU<mxN> dsu[2];
void dfs(int s, int p, int t){
# | 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... |