# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41360 | gabrielsimoes | Cop and Robber (BOI14_coprobber) | C++14 | 232 ms | 262144 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "coprobber.h"
#include <vector>
int pre[MAX_N], pos[MAX_N], t = 0;
int prev[MAX_N];
std::vector<int> g[MAX_N];
void dfs(int cur) {
pre[cur] = t++;
for (int nx : g[cur]) {
if (nx != prev[cur]) {
prev[nx] = cur;
dfs(nx);
}
}
pos[cur] = t++;
}
int start(int N, bool A[MAX_N][MAX_N]) {
for (int i = 0; i < N; i++) {
for (int k = 0; k < N; k++) {
if (A[i][k]) {
g[i].push_back(k);
}
}
}
dfs(0);
return 0;
}
# | 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... |