Submission #343346

#TimeUsernameProblemLanguageResultExecution timeMemory
343346TosicXoractive (IZhO19_xoractive)C++14
Compilation error
0 ms0 KiB
void toMs(vector<int>& tmp, multiset<int>& ms){ for(auto i : tmp){ if(!i){ continue; } ms.insert(i); } } map<int, int> idx; vector<int> guess(int n){ int fr = ask(1); for(int j = 0; j <= 6; ++j){ vector<int >a1; for(int i = 2; i <= n; ++i){ if((i>>j)&1){ a1.push_back(i); } } vector<int>a2 = a1; if(a2.empty()){ continue; } for(auto y : a1){ cout << y << ' '; } cout << '\n'; a2.push_back(1); a2=get_pairwise_xor(a2); a1=get_pairwise_xor(a1); multiset<int> tmp; toMs(a2, tmp); for(auto i : a1){ if(i and tmp.find(i) != tmp.end()){ tmp.erase(tmp.find(i)); } } for(auto i = tmp.begin(); i != tmp.end(); ++i){ idx[fr^*i] += (1<<j); ++i; } } vector<int> ans(n, 0); for(auto pr:idx){ ans[pr.second-1] = pr.first; } ans [0] =fr; return ans; }

Compilation message (stderr)

Xoractive.cpp:2:11: error: variable or field 'toMs' declared void
    2 | void toMs(vector<int>& tmp, multiset<int>& ms){
      |           ^~~~~~
Xoractive.cpp:2:11: error: 'vector' was not declared in this scope
Xoractive.cpp:2:18: error: expected primary-expression before 'int'
    2 | void toMs(vector<int>& tmp, multiset<int>& ms){
      |                  ^~~
Xoractive.cpp:2:29: error: 'multiset' was not declared in this scope
    2 | void toMs(vector<int>& tmp, multiset<int>& ms){
      |                             ^~~~~~~~
Xoractive.cpp:2:38: error: expected primary-expression before 'int'
    2 | void toMs(vector<int>& tmp, multiset<int>& ms){
      |                                      ^~~
Xoractive.cpp:11:1: error: 'map' does not name a type
   11 | map<int, int> idx;
      | ^~~
Xoractive.cpp:13:1: error: 'vector' does not name a type
   13 | vector<int> guess(int n){
      | ^~~~~~