답안 #933613

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
933613 2024-02-26T01:24:35 Z vjudge1 Speedrun (RMI21_speedrun) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include <speedrun.h>
using namespace std;

void assignHints (int subtask , int N, int A[], int B[])
{
	setHintLen(1);
	vector<int>adj(N+1);
	for (int i = 0; i < N; i++)
	{
		adj[A[i]]++;
		adj[B[i]]++;
	}
	for (int i = 0; i < N+1; i++)
	{
		if (adj[A[i]] == 1)
			continue
		setHint(i, 1, 1);
	}
}
void speedrun(int subtask , int N, int start )
{
	getHintLen()
	bool yo = getHint(1);
	int jefe;
	if (!yo)
	{
		for (int i = 1; i < N+1; i++)
		{
			if (i == start) continue;
			if (!goTo(i)) continue;
			jefe = i; break;
		}
	}
	else jefe = start;
	for (int i = 1; i <= N; i++)
	{
		if (i == jefe) continue;
		goTo(i);
		goTo(jefe);
	}
}

Compilation message

speedrun.cpp: In function 'void assignHints(int, int, int*, int*)':
speedrun.cpp:17:12: error: expected ';' before 'setHint'
   17 |    continue
      |            ^
      |            ;
   18 |   setHint(i, 1, 1);
      |   ~~~~~~~   
speedrun.cpp: In function 'void speedrun(int, int, int)':
speedrun.cpp:23:2: error: 'getHintLen' was not declared in this scope; did you mean 'setHintLen'?
   23 |  getHintLen()
      |  ^~~~~~~~~~
      |  setHintLen
speedrun.cpp:26:7: error: 'yo' was not declared in this scope; did you mean 'yn'?
   26 |  if (!yo)
      |       ^~
      |       yn