# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
161934 | Alexa2001 | Xoractive (IZhO19_xoractive) | C++17 | 17 ms | 400 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 <bits/stdc++.h>
using namespace std;
vector<int> guess(int n)
{
vector<int> ans(n), q, ans1, ans2;
map<int, int> mp;
int last = ask(n);
ans[n-1] = last;
int i, j;
for(i=0; i<7; ++i)
{
q.clear();
for(j=1; j<n; ++j)
if(j & (1<<i)) q.push_back(j);
if(q.size())
ans1 = get_pairwise_xor(q);
else ans1.clear();
q.push_back(n);
ans2 = get_pairwise_xor(q);
map<int,int> now;
for(auto it : ans1) --now[it];
for(auto it : ans2) ++now[it];
for(auto it : now)
if(it.first && it.second)
mp[it.first ^ last] |= (1<<i);
}
for(auto it : mp)
ans[it.second - 1] = it.first;
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |