답안 #224318

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
224318 2020-04-17T16:55:15 Z kshitij_sodani 카멜레온의 사랑 (JOI20_chameleon) C++17
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define a first
#define b second
#define pb push_back
//#include "chameleon.h"
int n;
void Solve(int n){
	int vis[2*n];
	for(int i=0;i<2*n;i++){
		vis[2*n]=0;
	}
	for(int i=0;i<2*n;i++){
		if(vis[2*n]==0){
			vector<int> aa;
			for(int j=0;j<2*n;j++){
				if(i==j){
					continue;
				}
				int x=Query({i+1,j+1});
				if(x==1){
					aa.pb(j+1);
				}
			}
			if(aa.size()==1){
				vis[i]=1;
				vis[aa[0]-1]=1;
				Answer(i+1,aa[0]);
			}
			else{
				for(int j=0;j<2;j++){
					for(int k=0;k<2;k++){
						if(Query({i+1,aa[j],aa[k]})==1){
							aa={aa[j],aa[k]};
						}
					}
				}

				vector<int> bb;
				for(int j=0;j<2*n;j++){
					if(j!=i and j!=aa[0]-1){
						bb.pb(j+1);
					}
				}
				int x=Query(bb);
				if(x==n){
					vis[i]=1;
					vis[aa[1]-1]=1;
					Answer(i+1,aa[1]);
				}
				else{
					vis[i]=1;
					vis[aa[0]-1]=1;
					Answer(i+1,aa[0]);
				}
			}
		}
	}
}
/*int main(){
	return 0;
}
*/

Compilation message

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:21:11: error: 'Query' was not declared in this scope
     int x=Query({i+1,j+1});
           ^~~~~
chameleon.cpp:29:5: error: 'Answer' was not declared in this scope
     Answer(i+1,aa[0]);
     ^~~~~~
chameleon.cpp:34:10: error: 'Query' was not declared in this scope
       if(Query({i+1,aa[j],aa[k]})==1){
          ^~~~~
chameleon.cpp:46:11: error: 'Query' was not declared in this scope
     int x=Query(bb);
           ^~~~~
chameleon.cpp:50:6: error: 'Answer' was not declared in this scope
      Answer(i+1,aa[1]);
      ^~~~~~
chameleon.cpp:55:6: error: 'Answer' was not declared in this scope
      Answer(i+1,aa[0]);
      ^~~~~~