제출 #37201

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
372012017-12-22 14:04:23aome007 (CEOI14_007)C++14
100 / 100
366 ms19956 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int INF = 1e9;
int n, m;
int p0, p1, a[2];
int dis[2][N];
int f[N], dis2[N];
bool lose[N];
vector<int> G[N];
void bfs(int t) {
for (int i = 1; i <= n; ++i) dis[t][i] = INF;
queue<int> qu; dis[t][a[t]] = 0, qu.push(a[t]);
while (qu.size()) {
int u = qu.front(); qu.pop();
for (auto v : G[u]) {
if (dis[t][v] == INF) {
dis[t][v] = dis[t][u] + 1, qu.push(v);
}
}
}
}
void dfs(int u) {
f[u] = 1;
for (auto v : G[u]) {
if (dis[0][v] + 1 != dis[0][u] || dis[1][v] + 1 != dis[1][u]) continue;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...