| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 333591 | nicholask | Werewolf (IOI18_werewolf) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "werewolf.h"
#include <bits/stdc++.h>
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 m=x.size(),q=s.size();
vector <int> g[n];
for (int i=0; i<m; i++){
g[x[i]].push_back(y[i]);
g[y[i]].push_back(x[i]);
}
vector <int> res;
for (int i=0; i<q; i++){
bool visited[n];
for (int j=0; j<n; j++) visited[i]=0;
queue <int> q;
if (s[i]>=l[i]){
q.push(s[i]);
visited[q[i]]=1;
}
while (!q.empty()){
int t=q.front();
q.pop();
for (auto&j:g[t]){
if (j>=l[i]&&!visited[j]){
q.push(j);
visited[j]=1;
}
}
}
for (int j=0; j<n; j++){
if (!visited[j]) continue;
bool vis[n];
for (int k=0; k<n; i++) vis[k]=0;
queue <int> r;
if (j<=r[i]){
r.push(j);
vis[j]=1;
}
while (!r.empty()){
int t=r.front();
r.pop();
if (t==e[i]){
res.push_back(1);
goto die;
}
for (auto&k:g[t]){
if (k<=r[i]&&!vis[k]){
r.push(k);
visited[k]=1;
}
}
}
}
ans.push_back(0);
die:;
}
return res;
}
