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) {
map<int,int>ani,fri;
int yo=ask(1);
for (int i = 0; i <= 6; ++i)
{
vector<int>cur,cur1;
fri.clear();
for (int j = 1; j < n; ++j)
{
if(j&(1<<i)){
cur.push_back(j+1);
}
}
if(!cur.size())continue;
cur1=cur;
cur1.push_back(1);
cur=get_pairwise_xor(cur);
cur1=get_pairwise_xor(cur1);
for(auto it:cur)fri[it]++;
for(auto it:cur1)fri[it]--;
for(auto it:fri){
if(it.second!=0)
ani[it.first^yo]|=(1<<i);
}
}
vector<int>ans;
ans.resize(n);
for(auto it:ani){
ans[it.second]=it.first;
}
ans[0]=yo;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |