답안 #266664

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
266664 2020-08-15T12:05:12 Z Toirov_Sadi 도서관 (JOI18_library) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>

using namespace std;

void Solve(int N){
    vector<int> res;
    res = {1};
    set<int> p;
    for(int i = 2; i <= N; i ++) p.insert(i);

    vector<int> q(N, 0);
    auto fll = [&](vector<int> &t){
        int good = 1;
        while(good == 1){
            int last = res.back();
            int nxt = -1;
            good = 0;
            for(auto x: p){
                if(good == 1) break;
                q[last - 1] = 1;
                q[x - 1] = 1;
                if(Query(q) == 1){
                    nxt = x;
                    good = 1;
                }
                q[last - 1] = 0;
                q[x - 1] = 0;
            }
            if(good == 1){
                p.erase(nxt);
                res.push_back(nxt);
            }
        }
    };
    fll(res);
    reverse(res.begin(), res.end());
    fll(res);
    Answer(res);
}

Compilation message

library.cpp: In lambda function:
library.cpp:22:20: error: 'Query' was not declared in this scope
   22 |                 if(Query(q) == 1){
      |                    ^~~~~
library.cpp: In function 'void Solve(int)':
library.cpp:38:5: error: 'Answer' was not declared in this scope
   38 |     Answer(res);
      |     ^~~~~~