Submission #677292

#TimeUsernameProblemLanguageResultExecution timeMemory
677292TruitadepatatesCop and Robber (BOI14_coprobber)C++14
16 / 100
195 ms262144 KiB
#include <bits/stdc++.h> using namespace std; //subtask 1 vector<int> adj[500]; int p[500]; 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[500][500]){ for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ if (a[i][j] == 1){ adj[i].push_back(j); } } } 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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...