# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
958069 | I_am_Polish_Girl | Xoractive (IZhO19_xoractive) | C++14 | 0 ms | 0 KiB |
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 <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <cmath>
#include <random>
#include <chrono>
using namespace std;
//#define int long long
int log_ = 10;
int inf = 1000000000000000000;
int mod = 998244353;
vector<int> guess(int n)
{
vector <int> ans(n);
ans[0] = ask(1);
map <int, int> nums_;
for (int i = 0; i <= 6; i++)
{
vector <int> ind;
for (int j = 1; j < n; j++)
{
if ((j & (1 << i)) != 0)
{
ind.push_back(j+1);
}
}
vector <int> ans1 = get_pairwise_xor(ind);
ind.push_back(1);
vector <int> ans2 = get_pairwise_xor(ind);
map <int, int> nums;
for (int i = 0; i < ans2.size(); i++)
{
nums[ans2[i]]++;
}
for (int i = 0; i < ans1.size(); i++)
{
nums[ans1[i]]--;
}
for (auto i_ : nums)
{
if (i_.second != 0)
{
nums_[i_.first ^ ans[0]] += (1 << i);
}
}
}
for (int i = 1; i < n; i++)
{
for (auto j : nums_)
{
if (j.second == i)
ans[i] = j.first;
}
}
return ans;
};