답안 #259344

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
259344 2020-08-07T16:13:34 Z youssefbou62 CEOI16_icc (CEOI16_icc) C++14
컴파일 오류
0 ms 0 KB
#include  <bits/stdc++.h>
#include “icc.h”
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;

#define mp make_pair
#define fi first
#define se second
#define all(v) v.begin(),v.end()
#define allarr(a) a , a + n
#define ll long long
#define ull unsigned long long 
#define pb push_back
#define fastio ios_base::sync_with_stdio(false) ; cin.tie(NULL); cout.tie(NULL)
#define sz(x)  (int)x.size() 
typedef pair<int, int> pi;
typedef pair<ll,ll> pll; 
typedef pair<int,pi> trp ;
typedef vector<pi> vpi;
typedef vector<pll> vpll ;
// int ab  (int  x ) { return (x>0?x:-x); }
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

const int MAXN = 105 ; 
int n ; 
int par[MAXN]; 
vector<int> groups , inG[MAXN]; 
void init(int N){
	for(int i = 1 ; i  <= N ; i++ )par[i] = i , groups.pb(i),inG[i].pb(i); 
}

int fs(int u){
	if( par[u] == u )return u; 
	return par[u] = fs(par[u]) ; 
}

void us(int u,int v){
	u = fs(u) ; 
	v = fs(v) ; 
	if( u == v )return ; 
	par[u] = v ;
	for(int x : inG[u])
		inG[v].pb(x) ; 
}

// int query(int size_a, int size_b, int a[], int b[]){
// 	cout << "QUERY *********"<<endl; 
// 	cout << size_a << endl; 
// 	for(int i = 0 ; i < size_a ; i++ )cout << a[i] << " " ;cout << endl; 
// 	cout << size_b << endl; 
// 	for(int i = 0 ; i < size_b ; i++ )cout << b[i] << " " ;cout << endl; 
// 	bool x ;
// 	cin >> x ; 
// 	return x ;
// }

// void setRoad(int a, int b){
// 	cout << "setRoad "<< a << " " << b << endl;
// return ; 
// }

void run(int N){
	N = n ; 
	init(n); 
	int a[N],b[N],c[N],d[N]; 
	for(int i = 0 ; i < n - 1 ; i++ ){
		int res1 = -1 , res2 = -1 ;
		int cnt = 0 ; 
		for(int j = 0 ; j < sz(groups) ; j++ ){
			int cnt1 = 0 ; 
			for(int  x = j + 1 ; x < sz(groups) ; x++ )for(int y : inG[groups[x]] ) b[cnt1] = y , cnt1 ++ ; 
			
					bool stop = 0;
				for(int y : inG[groups[j]]){
					a[cnt] = y; 
					cnt++; 
			
					if( query(cnt,cnt1,a,b)){
						res1 = y ;
						c[0] =  y ; 
						int l = j + 1 , r = sz(groups)-1 ; 
						while ( l <= r ){
							int mid = ( l + r )/ 2 ; 
							int yy = 0 ; 
							for(int x = l  ; x <= mid ;x++ ){
								for(int k :inG[groups[x]] ){

										d[yy] = k , yy++ ;

								}
							}
							if(query(1,yy,c,d))
								r = mid - 1 , res2 = groups[mid] ; 
							else l = mid + 1 ; 
						}
						stop = 1;
						break ; 
					}
				
			}
			if(stop)break; 

		}
		setRoad(res1,res2); 
		us(res1,res2); 
		groups.clear(); 
		for(int i = 1 ; i <= n ; i++ )
			if( find(all(groups),fs(i))== groups.end() )
				groups.pb(fs(i)) ; 
	
	}
}


// int main(){
// 	cin >> n ; 
// 	run(n) ; 
// }

Compilation message

icc.cpp:2:10: error: #include expects "FILENAME" or <FILENAME>
 #include “icc.h”
          ^
icc.cpp: In function 'void run(int)':
icc.cpp:80:10: error: 'query' was not declared in this scope
      if( query(cnt,cnt1,a,b)){
          ^~~~~
icc.cpp:106:3: error: 'setRoad' was not declared in this scope
   setRoad(res1,res2); 
   ^~~~~~~