답안 #101319

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
101319 2019-03-18T12:44:10 Z b2563125 도서관 (JOI18_library) C++14
컴파일 오류
0 ms 0 KB
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
using namespace std;
#define vel vector<int>
#define vvel vector<vel>
#define vvvel vector<vvel>
#define veb vector<bool>
void mmax(int &a, int b) { a = max(a, b); }
bool che(int i, int j, int n) {
	vel a(n, 0);
	a[i] = 1; a[j] = 1;
	return Query(a) == 1;
}
void Solve(int n) {
	if (n == 1) { vel res(1, 1); Answer(res); }
	vvel con(n);
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (che(i, j,n)) { con[i].push_back(j); con[j].push_back(i); }
		}
	}
	int th;
	for (int i = 0; i < n; i++) {
		if (con[i].size() == 1) { th = i; }
	}
	veb seen(false);
	seen[th] = true;
	vel ans(1, th + 1);
	th = con[th][0];
	while (con[th].size() > 1) {
		ans.push_back(th + 1);
		if (seen[con[th][0]]) { th = con[th][1]; }
		else { th = con[th][0]; }
	}
	ans.push_back(th + 1);
	Answer(ans);
}

Compilation message

library.cpp: In function 'bool che(int, int, int)':
library.cpp:17:9: error: 'Query' was not declared in this scope
  return Query(a) == 1;
         ^~~~~
library.cpp: In function 'void Solve(int)':
library.cpp:20:31: error: 'Answer' was not declared in this scope
  if (n == 1) { vel res(1, 1); Answer(res); }
                               ^~~~~~
library.cpp:41:2: error: 'Answer' was not declared in this scope
  Answer(ans);
  ^~~~~~