답안 #933571

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
933571 2024-02-25T23:17:51 Z vjudge1 Speedrun (RMI21_speedrun) C++17
컴파일 오류
0 ms 0 KB
//subtask 8 points
#include <algorithm>
#include <fstream>
#include <vector>
#include <queue>
#include <stack>
#include <iostream>
#include <cmath>
#include <queue>
#include <set>
#include <cstring>
#include <map>
#include <unordered_map>
//#include <bits/extc++.h>
#define F first
#define S second
#define PB push_back
using namespace std;
//using namespace __gnu_pbds;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ost;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<pair<int, ii>> viii;
typedef vector<vii> vvii;
typedef vector<ll> vll;
typedef vector<vll> vvll;

vvi al;
int par;

int findPar(int n){
    int ans=1;
    for(int i=1;i<=n;i++)
        if(al[i].size()>1)
            ans=i;
    return ans;
}

void assignHints(int subtasks, int n, int a[], int b[]){
    al.resize(n+1, vi());
    for(int i=1;i<n;i++){
        al[a[i]].PB(b[i]);
        al[b[i]].PB(a[i]);
    }
    par=findPar(n);
    setHintLen(1);
}

void speedRun(int subtasks, int n, int start){
    bool vis[n+1];
    memset(vis, false, n+1);
    vis[start]=true;
    if(start!=par){
        goTo(par);
        vis[par]=true;
    }
    for(int i=1;i<=n;i++){
        if(!vis[i]){
            vis[i]=true;
            goTo(i);
            goTo(par);
        }
    }
}

Compilation message

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:50:5: error: 'setHintLen' was not declared in this scope
   50 |     setHintLen(1);
      |     ^~~~~~~~~~
speedrun.cpp: In function 'void speedRun(int, int, int)':
speedrun.cpp:58:9: error: 'goTo' was not declared in this scope
   58 |         goTo(par);
      |         ^~~~
speedrun.cpp:64:13: error: 'goTo' was not declared in this scope
   64 |             goTo(i);
      |             ^~~~