# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
697440 | 2023-02-09T19:55:53 Z | Deepesson | Cop and Robber (BOI14_coprobber) | C++17 | 1 ms | 336 KB |
#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); } } return 0; } 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; int nextMove(int R) { obj=R; int strat = dfs(atual); assert(strat!=-1); return atual=strat; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Incorrect | 1 ms | 336 KB | the situation repeated |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 336 KB | the situation repeated |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Incorrect | 0 ms | 336 KB | the situation repeated |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Incorrect | 1 ms | 336 KB | the situation repeated |
4 | Halted | 0 ms | 0 KB | - |