답안 #35479

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
35479 2017-11-22T14:14:48 Z imaxblue CEOI16_icc (CEOI16_icc) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define x first
#define y second
#define pii pair<int, int>
#define p3i pair<pii, int>
#define pll pair<ll, ll>
#define p3l pair<pll, ll>
#define lseg L, (L+R)/2, N*2+1
#define rseg (L+R)/2+1, R, N*2+2
#define ub upper_bound
#define lb lower_bound
#define pq priority_queue
#define MN 1000000007
#define fox(k, x) for (int k=0; k<x; ++k)
#define fox1(k, x) for (int k=1; k<=x; ++k)
#define foxr(k, x) for (int k=x-1; k>=0; --k)
#define fox1r(k, x) for (int k=x; k>0; --k)
#define ms multiset
#define flood(x) memset(x, 0x3f3f3f3f, sizeof x)
#define drain(x) memset(x, 0, sizeof x)
#define rng() (rand() >> 3)*rand()

/*void setRoad(int x, int y){cout << "*" << x << ' ' << y << endl;}
bool query(int x, int y, vector<int> v, vector<int> w){
    fox(l, x) cout << v[l] << ' '; cout << endl;
    fox(l, y) cout << w[l] << ' '; cout << endl;
    int ans;
    cin >> ans;
    return ans;
};*/
int x, y, n;
vector<int> v, w, u;
void solve(){
    int lo=0, mid, hi=v.size()-1;
    while(lo<hi){
        mid=(lo+hi)/2;
        u.clear();
        fox(l, mid+1) u.pb(v[l]);
        if (query(mid+1, w.size(), u, w)){
            hi=mid;
        } else {
            lo=mid+1;
        }
    }
    x=v[lo];
    lo=0; hi=w.size()-1;
    while(lo<hi){
        mid=(lo+hi)/2;
        u.clear();
        fox(l, mid+1) u.pb(w[l]);
        if (query(v.size(), mid+1, v, u)){
            hi=mid;
        } else {
            lo=mid+1;
        }
    }
    y=w[lo];
}
void get(){
    for (int b=1; ; b<<=1){
        v.clear();
        w.clear();
        fox1(l, n){
            if (b&l) v.pb(l);
            else w.pb(l);
        }
        if (query(v.size(), w.size(), v, w)){
            solve();
            //cout << b << endl;
            return;
        }
    }
}
void run(int N){
    n=N;
    /*fox(l, N){
        v.pb(vector<int>(1, l+1));
    }*/
    fox(l, N-1){
        get();
        setRoad(x, y);
        /*fox(l, v[y].size()){
            v[x].pb(v[y][l]);
        }
        v.erase(v.begin()+y);*/
    }
}
/*int main(){
    run(4);
    return 0;
}*/

Compilation message

icc.cpp: In function 'void solve()':
icc.cpp:43:40: error: 'query' was not declared in this scope
         if (query(mid+1, w.size(), u, w)){
                                        ^
icc.cpp:55:40: error: 'query' was not declared in this scope
         if (query(v.size(), mid+1, v, u)){
                                        ^
icc.cpp: In function 'void get()':
icc.cpp:71:43: error: 'query' was not declared in this scope
         if (query(v.size(), w.size(), v, w)){
                                           ^
icc.cpp: In function 'void run(int)':
icc.cpp:85:21: error: 'setRoad' was not declared in this scope
         setRoad(x, y);
                     ^