This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "interactive.h"
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x) cerr<< #x <<" = "<< x<<endl;
using namespace std;
map<int,int>res,pm;
void add(vector<int>x){
tr(it,x)
pm[*it]++;
}
void rem(vector<int>x){
tr(it,x)
pm[*it]--;
}
vector<int> guess(int n) {
vector<int>ans(n),tmp;ans[0]=ask(1);
for(int j=0;(1<<j)<=n;j++){
pm.clear();tmp.clear();
for(int i=2;i<=n;i++)
if(i>>j&1)
tmp.pb(i);
rem(get_pairwise_xor(tmp));
tmp.pb(1);
add(get_pairwise_xor(tmp));
tr(it,pm)
if(it->ss>=2)
res[it->ff^ans[0]]^=(1<<j);
}
tr(it,res)
ans[it->ss-1]=it->ff;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |