Submission #524503

#TimeUsernameProblemLanguageResultExecution timeMemory
524503Mr_HusanboyXoractive (IZhO19_xoractive)C++14
100 / 100
4 ms380 KiB
#include "interactive.h" #include<bits/stdc++.h> using namespace std; vector<int> guess(int n) { vector<int> ans; if(n<15){ for(int i=1;i<=n;i++){ ans.push_back(ask(i)); }return ans; } int tem=ask(1); map<int,int> mp; for(int i=0;i<7;i++){ vector<int> t; for(int j=1;j<n;j++){ if(j>>i & 1) t.push_back(j+1); } vector<int> a=get_pairwise_xor(t); t.push_back(1); vector<int> b=get_pairwise_xor(t); map<int,int> m; for(auto u:a) m[u]--; for(auto u:b) m[u]++; for(auto u:m){ if(u.second>0) mp[u.first^tem]+=(1<<i); } }vector<int> ans2(n); ans2[0]=tem; for(auto u:mp) if(u.second<n) ans2[u.second]=u.first; return ans2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...