# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
116224 | zubec | 늑대인간 (IOI18_werewolf) | C++14 | 4091 ms | 28216 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "werewolf.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
vector <int> g[N];
int d[2][N];
std::vector<int> check_validity(int N, std::vector<int> X, std::vector<int> Y,
std::vector<int> S, std::vector<int> E,
std::vector<int> L, std::vector<int> R) {
int Q = S.size();
std::vector<int> A(Q);
for (int i = 0; i < X.size(); i++){
g[X[i]].push_back(Y[i]);
g[Y[i]].push_back(X[i]);
}
for (int i = 0; i < Q; i++){
for (int j = 0; j < N; j++){
d[0][j] = d[1][j] = 1e9;
}
d[0][S[i]] = 0;
queue <int> q;
q.push(S[i]);
while(!q.empty()){
int v = q.front();
q.pop();
for (int j = 0; j < g[v].size(); j++){
int to = g[v][j];
if (L[i] <= to && d[0][v] + 1 < d[0][to]){
d[0][to] = d[0][v] + 1;
q.push(to);
}
}
}
d[1][E[i]] = 0;
q.push(E[i]);
while(!q.empty()){
int v = q.front();
q.pop();
for (int j = 0; j < g[v].size(); j++){
int to = g[v][j];
if (to <= R[i] && d[1][v] + 1 < d[1][to]){
d[1][to] = d[1][v] + 1;
q.push(to);
}
}
}
bool bb = 0;
for (int j = L[i]; j <= R[i]; j++){
if (d[0][j] != 1e9 && d[1][j] != 1e9){
bb = 1;
break;
}
}
A[i] = bb;
}
return A;
}
컴파일 시 표준 에러 (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... |