Submission #521911

#TimeUsernameProblemLanguageResultExecution timeMemory
521911dostigatorXoractive (IZhO19_xoractive)C++17
Compilation error
0 ms0 KiB
#include "interactive.h"
#include <bits/stdc++.h>
using namespace std;

vector<int> guess(int n) {
	vector <int> ans(n+2);
	int base=ask(1);
	ans[1]=base;
	map<int,int>res;
	for(int i=0; i<7; ++i){
        vector<int>v;
        for(int x=1; x<=n; ++x) if((x>>i)&1) v.pb(x);
        vector<int>get=get_pairwise_xor(v);
        v.pb(1);
        vector<int>GET=get_pairwise_xor(v);
        for(int x:get) mp[x]++;
        for(int x:GET){
            if(mp[x]==0){
                res[x^base]|=(1<<i);
            }
            mp[x]--;
        }
	}
	for(int i=2; i<=n; ++i){
        ans[res[i]]=i;
	}
	return ans;
}

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:12:48: error: 'class std::vector<int>' has no member named 'pb'
   12 |         for(int x=1; x<=n; ++x) if((x>>i)&1) v.pb(x);
      |                                                ^~
Xoractive.cpp:14:11: error: 'class std::vector<int>' has no member named 'pb'
   14 |         v.pb(1);
      |           ^~
Xoractive.cpp:16:24: error: 'mp' was not declared in this scope
   16 |         for(int x:get) mp[x]++;
      |                        ^~
Xoractive.cpp:18:16: error: 'mp' was not declared in this scope
   18 |             if(mp[x]==0){
      |                ^~
Xoractive.cpp:21:13: error: 'mp' was not declared in this scope
   21 |             mp[x]--;
      |             ^~