Submission #398954

#TimeUsernameProblemLanguageResultExecution timeMemory
398954shrimbCop and Robber (BOI14_coprobber)C++17
16 / 100
57 ms1716 KiB
#include "coprobber.h" #include "bits/stdc++.h" using namespace std; vector<int> adj[501]; int cur = 0, nig; int start(int N, bool A[MAX_N][MAX_N]) { for (int i = 0 ; i < N ; i++) { for (int j = 0 ; j < N ; j++) { if (A[i][j]) adj[i].push_back(j); } } return 0; } bool check (int c, int p) { bool res = 0; for (int i : adj[c]) { if (i == p) continue; if (i == nig) return 1; res |= check(i, c); } return res; } int nextMove(int R) { nig = R; for (int i : adj[cur]) { if (i == R || check(i, cur)) return cur = i; } return -1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...