# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
168126 | 2019-12-11T13:11:31 Z | dimash241 | Library (JOI18_library) | C++17 | 0 ms | 0 KB |
#include<bits/stdc++.h> #include "library.h" #define pb push_back using namespace std; inline void Solve(int n) { vector <int> m(n); m[0] = 1; int mx = 0, p = 0; for(int i = 1; i < n; i ++) { m[i] = 1; int x; x = Query(m); if (x > mx) { mx = x; p = i; } m[i] = 0; } vector < pair < int, int > > res; m[0] = 0; //m[p] = 1; for (int i = 0; i < n; i ++) { m[p] = 1; m[i] = 1; res.pb({Query(m), i}); m[p] = 0; m[i] = 0; } sort(res.begin(), res.end()); vector < int > ans; for (int i = 0; i < n; i ++) ans.pb(res[i].second); Answer(ans); } // B...a