# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
850067 | divad | Speedrun (RMI21_speedrun) | C++14 | 0 ms | 0 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 <bits/stdc++.h>
#include "speedrun.h"
using namespace std;
const int NMAX = 1002;
vector<int> v[NMAX];
int n,l,vf[NMAX];
void assignHints (int subtask , int N, int A[], int B[]){
setHintLen(N);
for(int i = 1; i < N; i++){
v[A[i]].push_back(B[i]);
setHint(A[i], B[i], 1);
v[B[i]].push_back(B[i]);
setHint(B[i], A[i], 1);
}
}
void dfs(int nod, int tata = -1){
vf[nod] = 1;
for(int i = 1; i <= n; i++){
if(getHint(i) && vf[i] == 0){
goTo(i);
dfs(fiu, nod);
}
}
if(tata != -1){
goTo(tata);
}
}
void speedrun(int subtask , int N, int start){
n = N;
l = getLength();
dfs(start);
}