Submission #387151

#TimeUsernameProblemLanguageResultExecution timeMemory
387151kevinxiehkXoractive (IZhO19_xoractive)C++17
Compilation error
0 ms0 KiB
#include "interactive.h" #include "bits/stdc++.h" using namespace std; vector<int> guess(int n) { int ans[n]; ans[0] = ask(1); vector<int> hm[7]; vector<int> hv[7]; set<int> tot; for(int i = 0; i <= 6; i++) { for(int j = 2; j <= n; j++) { if(j & (1 << i)) hm[i].emplace_back(j); } if(hm[i].empty()) break; vector<int> have = get_pairwise_xor(hm[i]); hm[i].emlace_back(1); vector<int> have2 = get_pairwise_xor(hm[i]); int add = 0; for(int j = 0; j < have.size(); j++) { while(have[j] != have2[j + add]){ hv[i].emplace_back(have2[j + add] ^ ans[0]); tot.insert(have2[j + add] ^ ans[0]); add += 2; } } } for(auto x: tot) { int id = 0; for(int i = 0; i < 6; i++) { for(auto y: hv[i]) { if(x == y) { id += (1 << i); } } } ans[id - 1] = x; } return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:17:9: error: 'class std::vector<int>' has no member named 'emlace_back'; did you mean 'emplace_back'?
   17 |   hm[i].emlace_back(1);
      |         ^~~~~~~~~~~
      |         emplace_back
Xoractive.cpp:20:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |   for(int j = 0; j < have.size(); j++) {
      |                  ~~^~~~~~~~~~~~~
Xoractive.cpp:39:9: error: could not convert 'ans' from 'int [n]' to 'std::vector<int>'
   39 |  return ans;
      |         ^~~
      |         |
      |         int [n]