Submission #699837

#TimeUsernameProblemLanguageResultExecution timeMemory
699837NursikSpeedrun (RMI21_speedrun)C++14
0 / 100
44 ms768 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> using namespace std; #define pb push_back vector<int> g[2000]; void dfs(int v = 1, int p = 0){ if (p){ for (int i = 1; i <= 20; ++i){ if ((1 << (i - 1)) & p){ setHint(v, i, 1); } } } for (auto to : g[v]){ if (to != p){ dfs(to, v); } } } void assignHints(int subtask, int N, int A[], int B[]) { /* your solution here */ setHintLen(20); for (int i = 1; i < N; ++i){ int x = A[i], y = B[i]; g[x].pb(y); g[y].pb(x); } dfs(); } void dfs2(int v, int p){ for (auto to : g[v]){ if (to != p){ goTo(to); dfs2(to, v); } } if (p){ goTo(p); } } void speedrun(int subtask, int N, int start) { /* your solution here */ dfs2(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...