# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
105933 | luciocf | 경찰관과 강도 (BOI14_coprobber) | C++14 | 50 ms | 2808 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "coprobber.h"
using namespace std;
const int maxn = 510;
int n, U=0;
int dist[maxn][maxn];
vector<int> grafo[maxn];
void bfs(int s)
{
queue<int> fila;
dist[s][s] = 0; fila.push(s);
while (!fila.empty())
{
int u = fila.front();
fila.pop();
for (auto v: grafo[u])
{
if (dist[s][v] != -1) continue;
dist[s][v] = dist[s][u]+1;
fila.push(v);
}
}
}
int start(int N, bool A[MAX_N][MAX_N])
{
n = N;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (A[i][j])
grafo[i].push_back(j);
memset(dist, -1, sizeof dist);
for (int i = 0; i < n; i++)
bfs(i);
return 0;
}
int nextMove(int R)
{
for (auto v: grafo[U])
{
if (dist[v][R] == dist[U][R]-1)
{
U = v;
return v;
}
}
}
컴파일 시 표준 에러 (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... |