Submission #1211484

#TimeUsernameProblemLanguageResultExecution timeMemory
1211484Marco_EscandonXoractive (IZhO19_xoractive)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; typedef int ll; //int ask(int position); //vector<int> get_pairwise_xor(vector<int> positions); ll x; vector<int> guess2(vector<int> temp) { vector <int> ans; vector<ll> t1=get_pairwise_xor(temp); temp.push_back(1); vector<ll> t2=get_pairwise_xor(temp); map<ll,ll> mapa; for(auto i:t2) mapa[i]++; for(auto i:t1) mapa[i]--; mapa[0]--; for(auto i:mapa) { if(i.second>0) { ans.push_back(x^i.first); } } return ans; } vector<int> guess(int n) { x=ask(1); vector<map<ll,ll>> cad(n+1); map<ll,ll> c; c[x]++; for(int j=0; j<9; j++) { vector<ll> temp; for(int i=2; i<=n; i++) if((i&(1<<j))) temp.push_back(i); if(temp.size()==0) continue; temp=guess2(temp); for(auto i:temp) {c[i]++;} for(int i=2; i<=n; i++) { if((i&(1<<j))) { for(auto k:temp) { cad[i][k]++; } } } } cad[1][x]=1; vector<ll> ans; for(int i=1; i<=n; i++) { for(auto j:cad[i]) { if(j.second==c[j.first]&&j.second==__builtin_popcount(i)) { ans.push_back(j.first); break; } } } return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess2(std::vector<int>)':
Xoractive.cpp:11:19: error: 'get_pairwise_xor' was not declared in this scope
   11 |     vector<ll> t1=get_pairwise_xor(temp);
      |                   ^~~~~~~~~~~~~~~~
Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:28:7: error: 'ask' was not declared in this scope
   28 |     x=ask(1);
      |       ^~~