Submission #858868

#TimeUsernameProblemLanguageResultExecution timeMemory
858868teamariaaSpeedrun (RMI21_speedrun)C++17
21 / 100
25 ms1928 KiB
#include <bits/stdc++.h> #include "speedrun.h" using namespace std; #define MAX_N 1000 int n; bitset <MAX_N + 1> viz; void assign1(int a[], int b[]) { setHintLen(n); for(int i = 1; i < n; i ++) { setHint(a[i], b[i], 1); setHint(b[i], a[i], 1); } } void assign2and3() { } void assign4() { } void dfs(int node, int parent) { viz[node] = 1; for(int i = 1; i <= n; i ++) if(getHint(i) && !viz[i]) { goTo(i); dfs(i, node); } goTo(parent); } void speedrun1(int root) { dfs(root, root); } void assignHints(int subtask, int N, int A[], int B[]) { if(subtask == 1) { n = N; assign1(A, B); } } void speedrun(int subtask, int N, int start) { if(subtask == 1) { n = N; speedrun1(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...