Submission #345508

#TimeUsernameProblemLanguageResultExecution timeMemory
345508koketsuXoractive (IZhO19_xoractive)C++14
Compilation error
0 ms0 KiB
//#include "interactive.h" #include <iostream> #include <set> #include <map> #define LL long long #define pb push_back using namespace std; int Ans[101]; vector <int> Pos[101], Boo[101]; multiset <int> get(int A){ vector <int> E = get_pairwise_xor(Pos[A]); multiset <int> Q; for(int i : E){ Q.insert(i); } return Q; } vector <int> guess(int n){ int A = ask(1); Ans[true] = A; for(int i = 0; i < 7; i++){ for(int j = 2; j <= n; j++){ if(j & (1 << i)) Pos[i].pb(j); } } for(int i = 0; i < 7; i++){ if(!Pos[i].size()) continue; multiset <int> A1 = get(i); Pos[i].pb(1); multiset <int> A2 = get(i); //A2.erase(A2.find(0)); for(auto it : A1){ A2.erase(A2.find(it)); } for(auto it : A2){ Boo[i].pb(it ^ Ans[1]); } } map <int, int> Mp; for(int i = 0; i < 7; i++){ for(int j : Boo[i]){ Mp[j] |= j; } } for(int i = 0; i < 7; i++){ for(int j : Boo[i]){ Ans[Mp[j]] = j; } } vector <int> Dum; for(int i = 1; i <= n; i++){ Dum.pb(Ans[i]); } return Dum; }

Compilation message (stderr)

Xoractive.cpp:12:1: error: 'vector' does not name a type
   12 | vector <int> Pos[101], Boo[101];
      | ^~~~~~
Xoractive.cpp: In function 'std::multiset<int> get(int)':
Xoractive.cpp:15:5: error: 'vector' was not declared in this scope
   15 |     vector <int> E = get_pairwise_xor(Pos[A]);
      |     ^~~~~~
Xoractive.cpp:5:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    4 | #include <map>
  +++ |+#include <vector>
    5 | #define LL long long
Xoractive.cpp:15:13: error: expected primary-expression before 'int'
   15 |     vector <int> E = get_pairwise_xor(Pos[A]);
      |             ^~~
Xoractive.cpp:17:17: error: 'E' was not declared in this scope
   17 |     for(int i : E){
      |                 ^
Xoractive.cpp: At global scope:
Xoractive.cpp:23:1: error: 'vector' does not name a type
   23 | vector <int> guess(int n){
      | ^~~~~~