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;
const int MAXN = 40005;
map <int, int> M;
vector<int> guess(int n)
{
vector <int> ans(n);
ans[0] = ask(1);
for(int i = 0; i < 7; i++)
{
vector <int> id;
for(int j = 2; j <= n; j++)
{
if(j & (1 << i))
{
id.push_back(j);
}
}
vector <int> get1, get2;
get1 = get_pairwise_xor(id);
id.push_back(1);
get2 = get_pairwise_xor(id);
map <int, int> MM;
for(auto x : get1)
{
MM[x]++;
}
for(auto x : get2)
{
MM[x]--;
if(MM[x] == -1)
{
if(x != 0)
{
M[x ^ ans[0]] |= (1 << i);
}
}
}
}
for(auto x : M)
{
ans[x.second - 1] = x.first;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |