Submission #697446

#TimeUsernameProblemLanguageResultExecution timeMemory
697446DeepessonCop and Robber (BOI14_coprobber)C++17
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> using namespace std; #define MAX_N 500 // modify the following functions // you can define global variables and functions std::vector<int> con[MAX_N]; int start(int N, bool A[MAX_N][MAX_N]) { int count=0; for(int i=0;i!=N;++i){ for(int j=0;j!=N;++j){ if(i==j)continue; if(A[i][j]){ con[i].push_back(j); ++count; } } } if(count==2*(N-1))return 0; return -1; } int obj=0; int dfs(int pos,int prev=-1){ if(pos==obj){ return pos; } for(auto&x:con[pos]){ if(x==prev)continue; if(dfs(x,pos)){ return x; } } return -1; } int atual=0,previi=-1; int nextMove(int R) { obj=R; int strat = dfs(atual); previi=atual; return atual=strat; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...