# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
600590 | jack715 | 늑대인간 (IOI18_werewolf) | C++14 | 4098 ms | 22404 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "werewolf.h"
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define pp pop_back
#define mp make_pair
#define bb back
#define ff first
#define ss second
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 Q = s.size();
vector<int> A(Q);
vector<int> path[n];
for (int i = 0; i < x.size(); i++) {
path[x[i]].pb(y[i]);
path[y[i]].pb(x[i]);
}
queue<int> bfs;
for (int i = 0; i < Q; i++) {
vector<int> used(n, 0);
bfs.push(s[i]);
while (!bfs.empty()) {
int now = bfs.front();
bfs.pop();
for (int next : path[now]) {
if (used[next] || next < l[i]) continue;
used[next] = 1;
bfs.push(next);
}
}
for (int j = l[i]; j <= r[i]; j++) {
if (used[j]) bfs.push(j);
}
// cout << "WAY\n";
while (!bfs.empty()) {
int now = bfs.front();
bfs.pop();
for (int next : path[now]) {
if (used[next] || next > r[i]) continue;
used[next] = 1;
bfs.push(next);
}
}
// cout << "WUT\n";
if (used[e[i]]) A[i] = 1;
}
return A;
}
/*
6 6 3
5 1
1 2
1 3
3 4
3 0
5 2
4 2 1 2
4 2 2 2
5 4 3 4
*/
컴파일 시 표준 에러 (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... |