답안 #1088559

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1088559 2024-09-14T15:30:21 Z terracottalite CEOI16_icc (CEOI16_icc) C++14
컴파일 오류
0 ms 0 KB
#include <stdio.h>
#include "icc.h"
#include <set>
#include <vector>
using namespace std;

void run(int n) 
{
	vector<int> a[101];
	for (int i=1;i<=n;i++) a[i].push_back(i);

	vector<int> ff;
	vector<int> ss;
	set<int> st;
	for  (int i=0;i<n-1;i++) {
		for (int j=0;j<6;j++) {
			ff.clear();
			ss.clear();
			for (auto x : st) {
				if ((x>>j)&1) {
					for (auto k : a[x]) ff.push_back(k);
				} else {
					for (auto k : a[x]) ss.push_back(k);
				}
			}
			if (query(ff.size(), ss.size(), ff.data(), ss.data())) break;;
		}

		int l=0;
		int r=ff.size();
		while (r-l>1) {
			int m = (l+r)/2;
			if (query(r-m, ss.size(), ff.data()+m, ss.data())) l = m;
			else r = m;
		}
		l2=0;
		r2=ss.size();
		while (r2-l2>1) {
			int m = (l2+r2)/2;
			if (query(r2-m, ss.size(), ff.data()+l, ss.data()+m)) l = m;
			else r = m;
		}
		set.erase(l2);
		for (auto k : a[l2]) a[l].push_back(k);
		st.erase(l2);
		setRoad(l, l2);
	}
}

Compilation message

icc.cpp: In function 'void run(int)':
icc.cpp:36:3: error: 'l2' was not declared in this scope; did you mean 'l'?
   36 |   l2=0;
      |   ^~
      |   l
icc.cpp:37:3: error: 'r2' was not declared in this scope; did you mean 'r'?
   37 |   r2=ss.size();
      |   ^~
      |   r
icc.cpp:43:6: error: missing template arguments before '.' token
   43 |   set.erase(l2);
      |      ^