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 "speedrun.h"
#include <bits/stdc++.h>
#define FOR(v, s, e) for (int v = s; v < e; v++)
using namespace std;
void assignHints(int subtask, int N, int A[], int B[]) {
if (subtask == 1) {
setHintLen(N);
FOR(i, 1, N) {
setHint(A[i], B[i], 1);
setHint(B[i], A[i], 1);
}
}
}
void dfs(int nd, int par, int n) {
vector<int> possible;
FOR(i, 0, n) {
if (getHint(i + 1) == 1) {
possible.push_back(i + 1);
}
}
for(int node : possible) {
if (node == par) continue;
goTo(node);
dfs(node, nd, n);
}
if (par != -1) goTo(par);
}
void speedrun(int subtask, int N, int start) {
if (subtask == 1) {
dfs(start, -1, N);
}
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |