Submission #841511

#TimeUsernameProblemLanguageResultExecution timeMemory
841511Elvin_FritlXoractive (IZhO19_xoractive)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; /// #include "interactive.h" vector<int> guess(int n) { int eded = ask(1); map<int,int>mm; for(int mask=0;mask<7;mask++) { vector<int>v; for(int i=2;i<=n;i++) { if(i&(1<<mask)){ v.push_back(i); } } if(v.size() == 0) { continue; } vector<int> fi = get_pairwise_xor(v); v.push_back(1); vector<int> se = get_pairwise_xor(v); map<int,int> m; for(int i:fi) { m[i]--; } for(int i:se) { m[i]++; } vector<int>res; for(int i=0;i<se.size();i++){ if(m[se[i]] > 0){ mm[se[i]^eded] |= (1<<mask); } } } vector<int>res(n); res[0] = eded; for(auto [x,i]:mm){ assert(i > 0); res[i-1] = x; } return res; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:10:13: error: 'ask' was not declared in this scope
   10 |  int eded = ask(1);
      |             ^~~
Xoractive.cpp:25:26: error: 'get_pairwise_xor' was not declared in this scope
   25 |         vector<int> fi = get_pairwise_xor(v);
      |                          ^~~~~~~~~~~~~~~~
Xoractive.cpp:38:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |         for(int i=0;i<se.size();i++){
      |                     ~^~~~~~~~~~