# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
804182 | 2023-08-03T07:28:45 Z | vjudge1 | Library (JOI18_library) | C++14 | 1 ms | 1232 KB |
#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] = {} ; bool abu[N + 1][N + 1] = {} ; us[1] = 1 ; d.push_back(1) ; while(d.size() != n) { for(int i = 1 ; i <= n ; i++) { if(us[i] || abu[d.back()][i]) continue ; abu[d.back()][i] = 1 ; vector<int> v ; v.push_back(d.back()) ; 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] || abu[d[0]][i]) continue ; abu[d[0]][i] = 1 ; 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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1232 KB | Wrong Answer [1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 1232 KB | Wrong Answer [1] |
2 | Halted | 0 ms | 0 KB | - |