답안 #933584

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
933584 2024-02-26T00:31:48 Z vjudge1 Speedrun (RMI21_speedrun) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "speedrun.h"
#define endl '\n'
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define all(x) x.begin(),x.end()
#define fore(i,l,r) for(int i = l; i < r;i++)
#define forex(i,r,l) for(int i = r; i>= l;i--)
#define fo(i,n) fore(i,0,n)
#define ffo(i,n) forex(i,n-1,0)
#define lsb(x) x&(-x)
using namespace std;
using ii = pair<int,int>;using ll = long long; using ull = unsigned long long;
using vi = vector<int>;
// const int maxN = 30;
// int hintlen,mistart;vi res;
// int num[maxN];
// void setHintlen(int sz){
//     hintlen=sz;
// }
// void setHint(int a, int b, bool cl){
//     if(num[a]&1<<b == cl)return;
//     num[a]^=1<<b;
// }
// int getLength(){return hintlen;}
// bool getHint(int j ){
//     cout << mistart << " " << j << endl; cout.flush();
//     return (num[mistart]&(1<<j) ? 1 : 0 );
// }
// bool goTo(int j){
//     if(num[mistart]&(1<<j) == 0)return false;
//     res.pb(j);
//     mistart=j;
//     return true;
// }
void assignHints(int subtask, int N , int A[], int B[]){
    setHintlen(N);
    fore(i,1,N){
        setHint(A[i], B[i], 1);
        setHint(B[i], A[i], 1);
    }
}
vector<vector<int>> graph;
vector<bool> precalc, vis;int szn;
void dfs(int nodo, int donde = 0){
    if(!precalc[nodo]){
        precalc[nodo] = 1;
        fore(i,1,szn+1){
            if(getHint(i)){
                graph[nodo].pb(i);
            }
        }
    }
    for(int v : graph[nodo]){
        if(!vis[v]){
            vis[v]=1;
            goTo(v);dfs(v, nodo);
        }
    }
    if(donde == 0)return ;
    goTo(donde);
}
void speedrun(int subtask, int N, int start){
    vis.resize(N+2,0);precalc.resize(N+2,0);szn=N;
    graph.resize(N+2);getLength();
    vis[start] = 1;
    dfs(start);
}

Compilation message

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:39:5: error: 'setHintlen' was not declared in this scope; did you mean 'setHintLen'?
   39 |     setHintlen(N);
      |     ^~~~~~~~~~
      |     setHintLen