| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 500161 | aymanrs | 늑대인간 (IOI18_werewolf) | C++14 | 4035 ms | 43524 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "werewolf.h"
using namespace std;
struct node {
int id;
list<node*> l;
bool v;
};
vector<node> g;
void wolf(node*n, int r, bool w[]){
w[n->id] = true;
for(node* c : n->l){
if(!w[c->id] && c->id <= r) wolf(c, r, w);
}
}
bool human(node* n, int l, bool w[], int r){
n->v = true;
for(node* c : n->l){
if(w[c->id] && (c->id >= l || n->id <= r)) return true;
if(!c->v && c->id >= l && human(c, l, w, r)) return true;
}
return false;
}
vector<int> check_validity(int N, vector<int> X, vector<int> Y, vector<int> S, vector<int> E, vector<int> L, vector<int> R){
g.resize(N);
for(int i = 0;i < N;i++) g[i].id=i;
for(int i = 0;i < X.size();i++){
g[X[i]].l.push_back(&g[Y[i]]);
g[Y[i]].l.push_back(&g[X[i]]);
}
vector<int> ans(S.size(), 0);
for(int i = 0;i < S.size();i++){
for(int j = 0;j < N;j++) g[i].v = false;
bool w[N] = {false};
wolf(&g[E[i]], R[i], w);
if(human(&g[S[i]], L[i], w, R[i])) ans[i] = 1;
}
return ans;
}컴파일 시 표준 에러 (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... | ||||
