Submission #343351

#TimeUsernameProblemLanguageResultExecution timeMemory
343351TosicXoractive (IZhO19_xoractive)C++14
0 / 100
5 ms492 KiB
#include <bits/stdc++.h> #include "interactive.h" using namespace std; void toMs(vector<int>& tmp, multiset<int>& ms){ for(auto i : tmp){ if(!i){ continue; } ms.insert(i); } } map<int, int> idx; vector<int> guess(int n){ int fr = ask(1); for(int j = 0; j <= 6; ++j){ vector<int >a1; for(int i = 2; i <= n; ++i){ if((i>>j)&1){ a1.push_back(i); } } vector<int>a2 = a1; if(a2.empty()){ continue; } for(auto y : a1){ cout << y << ' '; } cout << '\n'; a2.push_back(1); a2=get_pairwise_xor(a2); a1=get_pairwise_xor(a1); multiset<int> tmp; toMs(a2, tmp); for(auto i : a1){ if(i and tmp.find(i) != tmp.end()){ tmp.erase(tmp.find(i)); } } for(auto i = tmp.begin(); i != tmp.end(); ++i){ idx[fr^*i] += (1<<j); ++i; } } vector<int> ans(n, 0); for(auto pr:idx){ ans[pr.second-1] = pr.first; } ans [0] =fr; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...