Submission #536975

# Submission time Handle Problem Language Result Execution time Memory
536975 2022-03-14T08:34:12 Z siewjh Speedrun (RMI21_speedrun) C++17
21 / 100
40 ms 672 KB
#include "speedrun.h"

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

void dfs(int curr, int par, int N){
    for (int i = 1; i <= N; i++){
        if (!getHint(i)) continue;
        if (i == par) continue;
        goTo(i);
        dfs(i, curr, 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 40 ms 616 KB Output is correct
2 Correct 40 ms 640 KB Output is correct
3 Correct 40 ms 556 KB Output is correct
4 Correct 33 ms 672 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 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 -