Submission #503498

#TimeUsernameProblemLanguageResultExecution timeMemory
503498GurbanXoractive (IZhO19_xoractive)C++17
0 / 100
5 ms328 KiB
#include "bits/stdc++.h" #include "interactive.h" using namespace std; const int maxn=105; int fir; set<int>arr[10]; set<int>A(vector<int>v){ if(v.empty()) return set<int>(); vector<int>now = v; now.push_back(1); vector<int>nw = get_pairwise_xor(now); vector<int>z = get_pairwise_xor(v); multiset<int>SS(nw.begin(),nw.end()); for(auto i : z) SS.erase(SS.find(i)); set<int>jg; for(auto i : SS) jg.insert(i ^ fir); jg.erase(fir); return jg; } set<int>un(set<int>A,set<int>B){ set<int>jog; for(auto i : A) if(B.find(i) != B.end()) jog.insert(i); return jog; } vector<int> guess(int n) { fir = ask(1); for(int i = 0;i <= 6;i++){ vector<int>now; for(int j = 2;j <= n;j++) if((1 << i) & j) now.push_back(j); arr[i] = A(now); } vector<int>ans; ans.push_back(fir); for(int i = 2;i <= n;i++){ set<int>now; for(int j = 0;j <= 6;j++){ if((1<<j) & i){ if(now.empty()) now = arr[j]; else now = un(now,arr[j]); } else for(auto k : arr[j]) now.erase(k); } assert(!now.empty()); ans.push_back(*now.begin()); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...