제출 #1018360

#제출 시각아이디문제언어결과실행 시간메모리
1018360vjudge1늑대인간 (IOI18_werewolf)C++17
15 / 100
260 ms16744 KiB
#include "werewolf.h" #include <bits/stdc++.h> #define pb push_back #define rep(a,b,c) for(int a=b; a<c; a++) #define repa(a,b) for(auto a:b) using namespace std; vector<int> check_validity(int N, vector<int> X, vector<int> Y, vector<int> S, vector<int> E, vector<int> L, vector<int> R) { int Q=S.size(), M=X.size(); if(N>3000 || M>6000 || Q>3000){ return {}; } vector<int> adj[N], A; rep(i,0,M){ adj[X[i]].pb(Y[i]); adj[Y[i]].pb(X[i]); } queue<int> q; rep(i,0,Q){ bool vis[N][2]{}; if(S[i]>=L[i]){ q.push(S[i]); q.push(0); } while(q.size()){ int u=q.front(); q.pop(); int z=q.front(); q.pop(); repa(v,adj[u]){ if(!z && v>=L[i] && !vis[v][z]){ vis[v][z]=true; q.push(v); q.push(z); } if(z && v<=R[i] && !vis[v][z]){ vis[v][z]=true; q.push(v); q.push(z); } } if(!z && L[i]<=u && R[i]>=u && !vis[u][1]){ vis[u][1]=true; q.push(u); q.push(1); } } A.pb(vis[E[i]][1]); } return A; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...