Submission #992701

# Submission time Handle Problem Language Result Execution time Memory
992701 2024-06-05T04:20:01 Z 12345678 Speedrun (RMI21_speedrun) C++17
21 / 100
30 ms 996 KB
#include "speedrun.h"
#include <bits/stdc++.h>

using namespace std;

const int nx=1e3+5;

int vs[nx], n;

void dfs(int u, int p)
{
    //cout<<"u "<<u<<'\n';
    vs[u]=1;
    for (int i=1; i<=n; i++) if (!vs[i]&&getHint(i)) goTo(i), dfs(i, u);
    if (u!=p) goTo(p);
}

void assignHints(int subtask, int N, 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); //cout<<"edge "<<A[i-1]<<' '<<B[i-1]<<'\n'; 
}

void speedrun(int subtask, int N, int start) {
    n=N;
    dfs(start, start);
}
# Verdict Execution time Memory Grader output
1 Correct 30 ms 932 KB Output is correct
2 Correct 22 ms 940 KB Output is correct
3 Correct 23 ms 976 KB Output is correct
4 Correct 24 ms 996 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB The length is too large
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB The length is too large
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB The length is too large
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB The length is too large
2 Halted 0 ms 0 KB -