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 <bits/stdc++.h>
#include "interactive.h"
using namespace std;
map<int, int> b;
set<int> s[8];
vector<int> guess(int n){
vector<int> ans(n), a[8], x;
ans[n-1] = ask(n);
for(int i=1; i<n; ++i) a[0].push_back(i);
for(int i=0; i<7; ++i)
for(int j=0; j<n-1; ++j)
if(!(j & (1<<i))) a[7-i].push_back(j+1);
for(int i=1; i<8; ++i){
x = get_pairwise_xor(a[i]);
a[i].push_back(n);
a[i] = get_pairwise_xor(a[i]);
x.push_back(0);
for(int j : x) a[i].erase(lower_bound(a[i].begin(), a[i].end(), j));
for(int &j : a[i]) if(j^=ans[n-1]) b[j] |= 1<<(7-i);
}
for(int i=1; i<8; ++i) for(int j : a[i]) ans[127^b[j]] = j;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |