# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
208350 | 2020-03-10T21:51:55 Z | MetB | Xoractive (IZhO19_xoractive) | C++14 | 0 ms | 0 KB |
#include "interactive.h" #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define N 2000001 using namespace std; typedef long long ll; typedef unsigned long long ull; const ll INF = 1e18, MOD = 1e9 + 7, MOD2 = 1e6 + 3; map <int, int> ind; int n; vector <int> guess () { cin >> n; int d = ask (1); for (int b = 0; b < 7; b++) { vector <int> v; for (int i = 2; i <= n; i++) { if (i & (1 << b)) v.push_back (i); } vector <int> ans = get_pairwise_xor (v); v.push_back (1); vector <int> ans2 = get_pairwise_xor (v); for (int a : ans) ans2.erase (find (ans.begin (), ans.end (), a)); sort (ans2.begin(), ans2.end()); for (int i = 1; i < ans2.size (); i += 2) { ind[ans2[i] ^ d] |= (1 << d); } } vector <int> ans (n); ans[0] = d; for (auto x : ind) { ans[x.second] = x.first; } return ans; }