Submission #536948

# Submission time Handle Problem Language Result Execution time Memory
536948 2022-03-14T08:02:30 Z squiddy Speedrun (RMI21_speedrun) C++17
21 / 100
47 ms 844 KB
#include "speedrun.h"
#include <bits/stdc++.h>

#define FOR(v, s, e) for (int v = s; v < e; v++)

using namespace std;

void assignHints(int subtask, int N, int A[], int B[]) { 
    if (subtask == 1) {
        setHintLen(N);
        FOR(i, 1, N) {
            setHint(A[i], B[i], 1);
            setHint(B[i], A[i], 1);
        }
    }
}

void dfs(int nd, int par, int n) {
    vector<int> possible;
    FOR(i, 0, n) {
        if (getHint(i + 1) == 1) {
            possible.push_back(i + 1);
        }
    }
    for(int node : possible) {
        if (node == par) continue;
        goTo(node);
        dfs(node, nd, n);
    }
    if (par != -1) goTo(par);
}


void speedrun(int subtask, int N, int start) {
    if (subtask == 1) {
        dfs(start, -1, N);
    }
}
# Verdict Execution time Memory Grader output
1 Correct 41 ms 844 KB Output is correct
2 Correct 39 ms 840 KB Output is correct
3 Correct 47 ms 712 KB Output is correct
4 Correct 42 ms 752 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB setHintLen was never called
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB setHintLen was never called
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB setHintLen was never called
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB setHintLen was never called
2 Halted 0 ms 0 KB -