답안 #944072

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
944072 2024-03-12T08:04:55 Z teacup 카멜레온의 사랑 (JOI20_chameleon) C++14
컴파일 오류
0 ms 0 KB
#include "chameleon.h"
#include <bits/stdc++.h>
using namespace std;

//#define int long long
#define ii pair<int,int>
typedef vector<int> vi;
#define iii tuple<int,int,int>
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef map<int,int> mii;

#ifndef debug 
    #define cerr if (0) cerr
#endif

void Solve(int N) {
	vector<int> V;
	for(int i=1; i<=2*N; i++){
		V.push_back(i);
	}
	
	while(!V.empty()){
		int L=0, R=V.size()-1, M, a, b;
		while(R>=L){
			M = (L+R)/2;
			a = Query(vector(v.begin(),v.begin()+M));
			b = Query(vector(v.begin()+1,v.begin()+M));
			if (a==b) R = M;
			else L = M+1;
		}
		a = V[0]; b = V[L];
		v.erase(v.begin());	v.erase(V.begin()+L);
		Answer(a,b);
	}
}

Compilation message

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:27:20: error: missing template arguments before '(' token
   27 |    a = Query(vector(v.begin(),v.begin()+M));
      |                    ^
chameleon.cpp:27:21: error: 'v' was not declared in this scope
   27 |    a = Query(vector(v.begin(),v.begin()+M));
      |                     ^
chameleon.cpp:28:20: error: missing template arguments before '(' token
   28 |    b = Query(vector(v.begin()+1,v.begin()+M));
      |                    ^
chameleon.cpp:33:3: error: 'v' was not declared in this scope
   33 |   v.erase(v.begin()); v.erase(V.begin()+L);
      |   ^