# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
976658 | irmuun | Werewolf (IOI18_werewolf) | C++17 | 4030 ms | 30236 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "werewolf.h"
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
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();
vector<int>can(Q,0);
vector<int>adj[N];
for(int i=0;i<X.size();i++){
adj[X[i]].pb(Y[i]);
adj[Y[i]].pb(X[i]);
}
vector<bool>human(N),wolf(N);
for(int i=0;i<Q;i++){
int s=S[i],e=E[i],l=L[i],r=R[i];
fill(all(human),0);
fill(all(wolf),0);
if(s<l){
break;
}
human[s]=true;
queue<int>q;
q.push(s);
while(!q.empty()){
int x=q.front();
q.pop();
for(int y:adj[x]){
if(y>=l&&!human[y]){
human[y]=true;
q.push(y);
}
}
}
for(int j=l;j<=r;j++){
if(human[j]){
wolf[j]=true;
q.push(j);
}
}
while(!q.empty()){
int x=q.front();
q.pop();
for(int y:adj[x]){
if(y<=r&&!wolf[y]){
wolf[y]=true;
q.push(y);
}
}
}
if(wolf[e]) can[i]=1;
}
return can;
}
컴파일 시 표준 에러 (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... |