Submission #1013053

#TimeUsernameProblemLanguageResultExecution timeMemory
1013053NintsiChkhaidzeXoractive (IZhO19_xoractive)C++17
100 / 100
6 ms852 KiB
#include "interactive.h" #include <bits/stdc++.h> #define pb push_back using namespace std; vector<int> guess(int n) { map <int,int> mp; vector <int> ans(n); ans[0] = ask(1); for (int b = 0; b < 7; b++) { vector <int> v; for (int i = 2; i <= n; i++){ if (((i >> b) & 1)) v.pb(i); } if (!v.size()) continue; vector <int> ans1 = get_pairwise_xor(v); v.pb(1); vector <int> ans2 = get_pairwise_xor(v); multiset <int> st1,st2; for (int x: ans1) st1.insert(x); for (int x: ans2) st2.insert(x); while (st1.size()){ st2.erase(st2.find(*st1.begin())); st1.erase(st1.begin()); } st2.erase(st2.find(0)); for (int x: st2){ mp[x ^ ans[0]] |= (1<<b); } } for (auto [x,y]: mp) ans[y - 1] = x; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...