제출 #538129

#제출 시각아이디문제언어결과실행 시간메모리
538129penguin133도서관 (JOI18_library)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

void solve(int N){
	int A[N+1];
	for(int i=1;i<=N;i++)A[i] = 0;
	vector<int>v;
	for(int i=1;i<=N;i++)v.push_back(1);
	vector<int>fin;
	for(int i=1;i<=N;i++){
		v[i-1] = 0;
		int ans = Query(v);
		if(ans == 1){fin.push_back(i), A[i-1] = 1; break;}
		v[i-1] = 1;
	}
	for(int i=2;i<=N;i++){
		int x = fin.back();
		v.clear();
		for(int i=0;i<N;i++)v.push_back(0);
		v[x-1] = 1;
		for(int j=1;j<=N;j++){
			if(A[j])continue;
			v[j-1] = 1;
			int ans = Query(v);
			if(ans == 1){fin.push_back(j), A[i-1] = 1; break;}
			v[j-1] = 0;
		}
	}
	Answer(fin);
}

컴파일 시 표준 에러 (stderr) 메시지

library.cpp: In function 'void solve(int)':
library.cpp:12:13: error: 'Query' was not declared in this scope
   12 |   int ans = Query(v);
      |             ^~~~~
library.cpp:24:14: error: 'Query' was not declared in this scope
   24 |    int ans = Query(v);
      |              ^~~~~
library.cpp:29:2: error: 'Answer' was not declared in this scope
   29 |  Answer(fin);
      |  ^~~~~~