제출 #82516

#제출 시각아이디문제언어결과실행 시간메모리
82516farukkastamonuda늑대인간 (IOI18_werewolf)C++14
0 / 100
4102 ms30760 KiB
#include "werewolf.h" #include <bits/stdc++.h> #define fi first #define se second #define lo long long #define inf 1000000009 #define md 1000000007 #define li 200005 #define mp make_pair #define pb push_back #define mid (start+end)/2 using namespace std; int vis[li][2]; queue< pair<int,int> > q; vector<int> v[li],ans; vector<int> check_validity(int N,vector<int> X,vector<int> Y,vector<int> S,vector<int> E,vector<int> L,vector<int> R){ for(int i=0;i<N;i++){ for(int j=0;j<N;j++) v[j].clear(); memset(vis,0,sizeof(vis)); for(int j=0;j<(int)X.size();j++){ v[X[j]].pb(Y[j]); v[Y[j]].pb(X[j]); } if(S[i]<L[i]) {ans.pb(0);continue;} if(S[i]>=L[i] && S[i]<=R[i]) q.push(mp(S[i],1)); q.push(mp(S[i],0)); int flag=0; while(!q.empty()){ pair<int,int> temp=q.front(); q.pop(); int seh=temp.fi; int tur=temp.se; if(tur==0 && seh<L[i]) continue; if(tur==1 && seh>R[i]) continue; if(vis[seh][tur]==1) continue; if(seh==E[i] && tur==1){ flag=1; break; } vis[seh][tur]=1; for(int j=0;j<(int)v[seh].size();j++){ int go=v[seh][j]; if(go>=L[i] && go<=R[i]) q.push(mp(go,1)); q.push(mp(go,tur)); } } if(flag==1) ans.pb(1); else ans.pb(0); } return ans; } //int main(){ // return 0; //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...