Submission #914982

# Submission time Handle Problem Language Result Execution time Memory
914982 2024-01-23T05:13:00 Z shenfe1 Xoractive (IZhO19_xoractive) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>


#pragma GCC optimize("03")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
using namespace std;

#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
#define F first
#define S second
#define mem(a,i) memset(a,i,sizeof(a))
#define sz(s) (int)s.size()
#define y1 yy
#define ppb pop_back
#define lb lower_bound
#define ub upper_bound
#define gcd(a,b) __gcd(a,b)
#define in insert

const int MAX=3e5+15;
const int B=2e5;
const int N=104;
const int block=450;
const int maxB=MAX/B+10;
const ll inf=1e18;  
const int mod=1e9+7;
const int mod1=1e9+9;
const ld eps=1e-9;

int dx[8]={1,0,-1,0,1,-1,-1,1};
int dy[8]={0,1,0,-1,1,-1,1,-1};

int a[MAX];
map<int,int> mp;

vector<int> guess(int n){
  vector<int> ans;
  a[1]=ask(1);
  for(int i=0;i<7;i++){
    vector<int> ask,ask1;
    for(int j=1;j<=n;j++){
      if((j>>i)&1){
        if(j!=1){
          ask.pb(j);
          ask1.pb(j);
        }
      }
    }
    ask1.pb(1);
    vector<int> v=get_pairwise_xor(ask);
    vector<int> v1=get_pairwise_xor(ask1);
    multiset<int> st;
    for(int x:v1)st.in(x);
    for(int x:v){
      st.erase(st.find(x));
    }
    st.erase(st.find(0));
    for(int x:st){
      mp[(x^a[1])]+=(1<<i);
    }
  }
  for(pii x:mp){
    a[x.S]=x.F;
  }
  for(int i=1;i<=n;i++)ans.pb(a[i]);
  return ans;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:44:8: error: 'ask' was not declared in this scope
   44 |   a[1]=ask(1);
      |        ^~~
Xoractive.cpp:56:19: error: 'get_pairwise_xor' was not declared in this scope
   56 |     vector<int> v=get_pairwise_xor(ask);
      |                   ^~~~~~~~~~~~~~~~