Submission #1220978

#TimeUsernameProblemLanguageResultExecution timeMemory
1220978siyanaXoractive (IZhO19_xoractive)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; const int MAXN=110; const int PAW=10; vector<int>g[PAW]; vector<int>a[PAW]; map<int,int>m; int arr[MAXN]; vector<int>find_multitude_numbers(vector<int>pos,int x){ multiset<int> ms=get_pairwise_xor(pos); while(ms.find(0)!=ms.end()) ms.erase(0); pos.push_back(1); multiset<int>v=get_pairwise_xor(pos); while(ms.find(0)!=ms.end()) ms.erase(0); vector<int>nv; for(int el:v){ if(ms.find(el)!=ms.end()){ ms.erase(ms.find(el)); }else{ nv.push_back(el); } } nv.push_back(1); for(int i=0;i<nv.size();i++){ nv[i]=nv[i]^x; } return nv; } vector<int> guess(int n){ int x=ask(1); for(int paw=0;paw<=6;paw++){ for(int i=2;i<=n;i++){ if(i&(1<<paw)!=0){ g[paw].push_back(i); } } a[paw]=find_multitude_numbers(g[paw],x); } for(int paw=0;paw<=6;paw++){ for(int el:a[paw]){ m[el]+=(1<<paw); } } for(auto it:m){ if(it.first!=0){ arr[it.second]=it.first; } } vector<int>result; for(int i=0;i<n;i++){ result.push_back(arr[i]); } return result; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> find_multitude_numbers(std::vector<int>, int)':
Xoractive.cpp:10:22: error: 'get_pairwise_xor' was not declared in this scope
   10 |     multiset<int> ms=get_pairwise_xor(pos);
      |                      ^~~~~~~~~~~~~~~~
Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:30:11: error: 'ask' was not declared in this scope
   30 |     int x=ask(1);
      |           ^~~