| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 677284 | Truitadepatates | 경찰관과 강도 (BOI14_coprobber) | C++14 | 0 ms | 0 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
//subtask 1
vector<vector<int>> adj(507, vector<int>(507));
vector<int> p(507);
int cop = 0;
void dfs(int actual, int anterior){
  p[actual] = anterior;
  for (auto it: adj[actual]){
    if (it != anterior){
      dfs(it, actual);
    }
  }
}
int start(int n, bool a[507][507]){
  for (int i = 0; i < n; i++){
    for (int j = 0; j < n; j++){
      if (a[i][j] == 1){
        adj[i].push_back(j);
        adj[j].push_back(i);
      }
    }
  }
  dfs(0, -1);
  return 0;
}
int nextMove(int r){
  if (r == cop) return r;
  else{
    while (cop != p[r]){
      r = p[r];
    }
  }
  cop = r;
  return r;
}
