Submission #764864

#TimeUsernameProblemLanguageResultExecution timeMemory
764864vjudge1Speedrun (RMI21_speedrun)C++17
0 / 100
34 ms47520 KiB
#include <algorithm> #include <iostream> #include <iomanip> #include <bitset> #include <cmath> #include <queue> #include <map> #include <set> #include "speedrun.h" // Akhmet Issa using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define ent "\n" const int maxn = 1e6 + 100; const ll INF = (ll)2e18; const int inf = (ll)2e9; const int maxl = 20; const int MOD = 1e9 + 7; vector<int> g[maxn]; int used[maxn]; void assignHints(int subtask, int n, int A [], int B []){ for(int i = 1; i < n; i++){ g[A[i]].push_back(B[i]); g[B[i]].push_back(A[i]); } setHintLen(n); for(int i = 1; i <= n; i++){ for(int to: g[i]){ setHint(i, to, 1); } } } void speedrun(int subtask, int n, int start){ used[start] = 1; for(int i = 1; i <= n; i++){ if(getHint(i) && !used[i]){ speedrun(subtask, n, i); } } }
#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...