Submission #933591

#TimeUsernameProblemLanguageResultExecution timeMemory
933591vjudge1Speedrun (RMI21_speedrun)C++17
0 / 100
1 ms352 KiB
//subtask 21 points #include <algorithm> #include <fstream> #include <vector> #include <queue> #include <stack> #include <iostream> #include <cmath> #include <queue> #include <set> #include <cstring> #include <map> #include <unordered_map> //#include <bits/extc++.h> #define F first #define S second #define PB push_back using namespace std; //using namespace __gnu_pbds; //typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ost; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<pair<int, ii>> viii; typedef vector<vii> vvii; typedef vector<ll> vll; typedef vector<vll> vvll; void setHintLen (int l); void setHint(int i, int j, bool b); int getLength (); bool getHint(int j); bool goTo(int x); vvi al; int st, N; void dfs(int node, int p){ for(int i=1;i<=N;i++){ if(i!=p && getHint(i-1)){ goTo(i); dfs(i, node); } } if(node!=st) goTo(p); } void assignHints(int subtasks, int n, int a[], int b[]){ al.resize(n+1, vi()); for(int i=1;i<n;i++){ al[a[i]].PB(b[i]); al[b[i]].PB(a[i]); } setHintLen(n); for(int i=1;i<=n;i++){ for(auto ch:al[i]) setHint(i, ch-1, 1); } } void speedrun(int subtask, int n, int start){ st=start; 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...