This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// M
#include<bits/stdc++.h>
#include "interactive.h"
using namespace std;
const int LG = 7;
vector < int > guess(int n)
{
vector < int > Res(n);
Res[0] = ask(1);
map < int , int > MP;
for (int j = 0; j < 7; j ++)
if ((1 << j) < n)
{
vector < int > vec;
for (int i = 1; i < n; i ++)
if (i >> j & 1)
vec.push_back(i + 1);
vector < int > A = get_pairwise_xor(vec);
vec.push_back(1);
vector < int > B = get_pairwise_xor(vec);
map < int , int > C;
for (int a : A) C[a] --;
for (int a : B) C[a] ++;
for (auto X : C)
if (X.first && X.second)
MP[X.first ^ Res[0]] += 1 << j;
}
for (auto X : MP)
Res[X.second] = X.first;
return Res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |