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>
using namespace std;
vector<int> guess(int n) {
int tem=ask(1);
map<int,int> mp;
for(int i=0;i<7;i++){
vector<int> t;
for(int j=1;j<n;j++){
if(j>>i & 1) t.push_back(j+1);
}
vector<int> a=get_pairwise_xor(t);
t.push_back(1);
vector<int> b=get_pairwise_xor(t);
map<int,int> m;
for(auto u:a) m[u]--;
for(auto u:b) m[u]++;
for(auto u:m){
if(u.second>0) mp[u.first^tem]+=(1<<i);
}
}vector<int> ans2(n);
ans2[0]=tem;
for(auto u:mp) if(u.second<n) ans2[u.second]=u.first;
return ans2;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |