#include <bits/stdc++.h>
using namespace std;
#define ll int
#define pb push_back
#include "interactive.h"
vector<int> guess(int n) {
vector <ll> ans(n),q,a,a1;
multiset<ll> s;
map<ll,ll> m;
ans[0] = (ask(1));
for(int bit = 0; bit < 7; bit++){
q.clear();
s.clear();
for(int i = 2; i <= n; i++){
if((1 << bit) & i) q.pb(i);
}
if(q.empty()) continue;
a1 = get_pairwise_xor(q);
q.pb(1);
a = get_pairwise_xor(q);
for(auto it : a) s.insert(it);
for(auto it : a1) s.erase(s.find(it));
s.erase(s.begin());
for(auto it = s.begin(); it != s.end(); (++it, ++it)) m[*it ^ ans[0]] += (1 << bit);
}
for(auto it : m) ans[it.second - 1] = it.first;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |