# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
90139 | nikolapesic2802 | Cop and Robber (BOI14_coprobber) | C++14 | 59 ms | 7672 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "coprobber.h"
using namespace std;
#define pb push_back
pair<int,int> dp[MAX_N][MAX_N][2];
vector<vector<int> > graf(MAX_N);
int visited[MAX_N][MAX_N][2];
int calc(int cop,int robber,int move)
{
if(visited[cop][robber][move]==2)
return dp[cop][robber][move].first;
//printf("Racunam %i %i %i\n",cop,robber,move);
visited[cop][robber][move]=1;
if(move==0)
{
if(visited[cop][robber][1]==0||visited[cop][robber][1]==2)
{
int d=calc(cop,robber,1);
if(d!=-1)
{
d++;
if(dp[cop][robber][move].first==-1||dp[cop][robber][move].first>d)
dp[cop][robber][move]=make_pair(d,cop);
}
}
for(auto p:graf[cop])
{
if(visited[p][robber][1]==1)
continue;
int d=calc(p,robber,1);
# | 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... |