Submission #699819

#TimeUsernameProblemLanguageResultExecution timeMemory
699819NursikSpeedrun (RMI21_speedrun)C++14
0 / 100
1 ms336 KiB
#include "speedrun.h" #include <iostream> #include <fstream> #include <iomanip> #include <vector> #include <set> #include <map> #include <cstring> #include <string> #include <cmath> #include <cassert> #include <ctime> #include <algorithm> #include <sstream> #include <list> #include <queue> #include <deque> #include <stack> #include <cstdlib> #include <cstdio> #include <iterator> #include <functional> #include <unordered_set> #include <unordered_map> #include <stdio.h> #include <bitset> int n; void assignHints(int subtask, int N, int A[], int B[]) { /* your solution here */ setHintLen(N); for (int i = 0; i < N - 1; ++i){ int x = A[i], y = B[i]; setHint(x, y - 1, 1); setHint(y, x - 1, 1); } } void dfs(int v, int p){ // cout << v << " " << for (int j = 1; j <= n; ++j){ if (j != p && getHint(j - 1)){ goTo(j); dfs(j, v); } } if (p){ goTo(p); } } void speedrun(int subtask, int N, int start) { /* your solution here */ n = N; dfs(start, 0); }
#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...