Submission #850070

# Submission time Handle Problem Language Result Execution time Memory
850070 2023-09-15T17:17:12 Z divad Speedrun (RMI21_speedrun) C++14
21 / 100
28 ms 2428 KB
#include <bits/stdc++.h>
#include "speedrun.h"
using namespace std;

const int NMAX = 1002;
vector<int> v[NMAX];
int n,l,vf[NMAX];

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

void dfs(int nod, int tata = -1){
    vf[nod] = 1;
    for(int i = 1; i <= n; i++){
        if(getHint(i) && vf[i] == 0){
            goTo(i);
            dfs(i, nod);
        }
    }
    if(tata != -1){
        goTo(tata);
    }
}

void speedrun(int subtask , int N, int start){
    n = N;
    l = getLength();
    dfs(start);
}
# Verdict Execution time Memory Grader output
1 Correct 26 ms 2352 KB Output is correct
2 Correct 22 ms 2412 KB Output is correct
3 Correct 24 ms 2428 KB Output is correct
4 Correct 28 ms 2108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 1 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 -