Submission #266664

#TimeUsernameProblemLanguageResultExecution timeMemory
266664Toirov_Sadi도서관 (JOI18_library)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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);
      |     ^~~~~~