Submission #503655

#TimeUsernameProblemLanguageResultExecution timeMemory
503655blueSpeedrun (RMI21_speedrun)C++17
0 / 100
3532 ms4168 KiB
#include "speedrun.h" #include <vector> #include <algorithm> using namespace std; using vi = vector<int>; using vvi = vector<vi>; const int maxN = 1'000; void assignHints(int subtask, int N, int A[], int B[]) { setHintLen(N); vvi edg(1+N, vi(1+N, 0)); for(int e = 1; e <= N-1; e++) edg[A[e]][B[e]] = edg[B[e]][A[e]] = 1; for(int u = 1; u <= N; u++) for(int v = 1; v <= N; v++) setHint(u, v, edg[u][v]); } int N; vi visit(1+maxN, 0); void dfs(int u) { visit[u] = 1; for(int v = 1; v <= N; v++) { if(visit[v]) continue; if(getHint(v)) { goTo(v); dfs(v); goTo(u); } } } void speedrun(int subtask, int N_, int start) { N = N_; dfs(start); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...