Submission #370891

#TimeUsernameProblemLanguageResultExecution timeMemory
370891daniel920712Xoractive (IZhO19_xoractive)C++14
100 / 100
5 ms640 KiB
#include "interactive.h" #include <stdio.h> #include <vector> #include <set> #include <map> using namespace std; set < int > all; map < int , int > A; map < int , int > B; map < int , int > xx; bool have[105]; set < int > AA; set < int > BB; set < int > bit[15][15]; vector < int > how; vector < int > ans; vector < int > tt; vector < int > tt2; void F2(int here) { int i,j; A.clear(); B.clear(); tt.clear(); for(auto i:how) { //printf("%d\n",i); tt.push_back(i+1); } tt2=get_pairwise_xor(tt); for(auto i:tt2) if(i) A[i]++; tt.clear(); for(auto i:how) if(i) tt.push_back(i+1); tt2=get_pairwise_xor(tt); for(auto i:tt2) if(i) A[i]--; bit[0][here].insert(ans[0]); for(auto i:A) { for(j=0;j<i.second/2;j++) bit[0][here].insert(i.first^ans[0]); } for(auto i:bit[0][here]) if(i!=ans[0]) xx[i]+=(1<<here); } vector<int> guess(int N) { int i,j,big=0; for(i=0;i<N;i++) ans.push_back(0); if(N<=2) { for(i=0;i<N;i++) ans[i]=ask(i+1); return ans; } else { ans[0]=ask(1); for(i=0;i<10;i++) { how.clear(); how.push_back(0); for(j=0;j<N;j++) { if((j&(1<<i))) { how.push_back(j); } } if(how.size()==1) break; F2(i); } for(auto i:xx) ans[i.second]=i.first; } return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'void F2(int)':
Xoractive.cpp:25:9: warning: unused variable 'i' [-Wunused-variable]
   25 |     int i,j;
      |         ^
Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:53:13: warning: unused variable 'big' [-Wunused-variable]
   53 |     int i,j,big=0;
      |             ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...