Submission #377089

#TimeUsernameProblemLanguageResultExecution timeMemory
377089eulerdesojaXoractive (IZhO19_xoractive)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include<fstream> using namespace std; #define ll long long #define pb push_back #define sz(x) int(x.size()) typedef pair<int,int>ii; typedef vector<int> vi; vi guess(int n){ int a0=ask(1); vi ans; multiset<int> tab[7]; for(int k=0;k<7;k++){ vi ax,ax1; ax1.pb(1); for(int i=1;i<n;i++){ if(i&(1<<k)){ ax.pb(i+1); ax1.pb(i+1); } } vi q=get_pairwise_xor(ax); vi q1=get_pairwise_xor(ax1); int i=0,i1=0; while(!q[i])i++; while(!q1[i1])i1++; while(i<sz(q) && i1<sz(q1)){ if(q[i] != q1[i1]){ tab[k].insert({(q1[i1]^a0)}); i1+=2; } else{ i+=2; i1+=2; } } } for(int i=n-1;i>0;i--){ vi aux; for(int j=0;j<7;j++){ if(i&(1<<j))aux.pb(j); } int ini=aux[0]; for(auto it=tab[ini].begin();it!=tab[ini].end();it++){ int cur=*it; bool ok=true; for(int k=1;k<sz(aux);k++)if(!tab[aux[k]].count(cur)){ ok=false; break; } if(ok){ ans.pb(cur); for(int k=0;k<sz(aux);k++){ tab[aux[k]].erase(tab[aux[k]].find(cur)); } break; } } } ans.pb(a0); reverse(ans.begin(),ans.end()); return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'vi guess(int)':
Xoractive.cpp:13:9: error: 'ask' was not declared in this scope
   13 |  int a0=ask(1);
      |         ^~~
Xoractive.cpp:25:8: error: 'get_pairwise_xor' was not declared in this scope
   25 |   vi q=get_pairwise_xor(ax);
      |        ^~~~~~~~~~~~~~~~