Submission #958711

#TimeUsernameProblemLanguageResultExecution timeMemory
958711Darren0724Xoractive (IZhO19_xoractive)C++17
100 / 100
4 ms596 KiB
#include "interactive.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; vector<int> guess(int n) { vector<int> rec(n); rec[0]=ask(1); map<int,int> ans; for(int i=1;i<=n;i=i<<1){ vector<int> r; for(int j=2;j<=n;j++){ if(j&i)r.push_back(j); } map<int,int> m; auto v1=get_pairwise_xor(r); r.push_back(1); auto v2=get_pairwise_xor(r); for(int j:v2)m[j]++; for(int j:v1)m[j]--; for(auto [a,b]:m){ if(b!=0){ ans[a]|=i; } } } for(auto [a,b]:ans){ if(a==0)continue; rec[b-1]=a^rec[0]; } return rec; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...