Submission #804148

#TimeUsernameProblemLanguageResultExecution timeMemory
804148vjudge1Library (JOI18_library)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include<library.h> using namespace std ; const int N = 1000 ; //int query(vector<int>& v) //{ // int num ; // cout << "? " ; // for(int i : v) // cout << i << ' ' ; // cout << '\n' ; // cin >> num ; // return num ; //} //void Answer(vector<int>&res) //{ // cout << "! " ; // for(int i : res) // cout << i << ' ' ; // exit(0) ; //} void Solve(int n) { vector<int> ans ; deque<int> d ; if(n <= 200) { bool us[N + 1] = {} ; us[1] = 1 ; int r ; d.push_back(1) ; while(d.size() != n) { r = d.size() - 1 ; for(int i = 1 ; i <= n ; i++) { if(us[i]) continue ; vector<int> v ; v.push_back(d[r]) ; v.push_back(i) ; if(query(v) == 1) { us[i] = 1 ; d.push_back(i) ; break ; } } for(int i = 1 ; i <= n ; i++) { if(us[i]) continue ; vector<int> v ; v.push_back(d[0]) ; v.push_back(i) ; if(query(v) == 1) { us[i] = 1 ; d.push_front(i) ; break ; } } } for(int i : d) ans.push_back(i) ; Answer(ans) ; } } //signed main() //{ // int n ; // cin >> n ; // Solve(n) ; // return 0 ; //}

Compilation message (stderr)

library.cpp: In function 'void Solve(int)':
library.cpp:32:24: warning: comparison of integer expressions of different signedness: 'std::deque<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   32 |         while(d.size() != n)
      |               ~~~~~~~~~^~~~
library.cpp:42:20: error: 'query' was not declared in this scope; did you mean 'Query'?
   42 |                 if(query(v) == 1)
      |                    ^~~~~
      |                    Query
library.cpp:56:20: error: 'query' was not declared in this scope; did you mean 'Query'?
   56 |                 if(query(v) == 1)
      |                    ^~~~~
      |                    Query