Submission #857694

# Submission time Handle Problem Language Result Execution time Memory
857694 2023-10-06T15:39:23 Z Vanio Speedrun (RMI21_speedrun) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "speedrun.h"
using namespace std;

void assignHints(int st, int n, int a[], int b[]){
    int i;
    setHintLen(n);
    for(i=1;i<n;i++){
        setHint(a[i],b[i],1);
        setHint(b[i],a[i],1);
    }
}

bool f[1001];

void rec(int k, int p){
    int i;
    f[k]=1;
    for(i=1;i<n;i++){
        if(getHint(i) && !f[i]){
            goTo(i);
            rec(i,k);
        }
    }
    goTo(p);
}

void speedrun(int st, int n, int start){
    rec(start,0);
}

Compilation message

speedrun.cpp: In function 'void rec(int, int)':
speedrun.cpp:19:15: error: 'n' was not declared in this scope
   19 |     for(i=1;i<n;i++){
      |               ^