# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
618710 | HappyPacMan | Xoractive (IZhO19_xoractive) | C++14 | 15 ms | 1364 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) {
multiset<int> px[7];
for(int i=0;i<7;i++){
vector<int> gpx;
for(int j=0;j<n;j++){
if(!(j & (1 << i))){
gpx.push_back(j+1);
}
}
vector<int> qans = get_pairwise_xor(gpx);
for(int it : qans){
px[i].insert(it);
}
}
for(int i=0;i<7;i++){
vector<int> gpx;
for(int j=1;j<n;j++){
if(!(j & (1 << i))){
gpx.push_back(j+1);
}
}
vector<int> qans = get_pairwise_xor(gpx);
for(int it : qans){
px[i].erase(px[i].lower_bound(it));
}
}
for(int i=0;i<7;i++){
px[i].erase(px[i].lower_bound(0));
}
int fr = ask(1);
set<int> numbers;
for(int i=0;i<7;i++){
for(int it : px[i]){
numbers.insert(it^fr);
}
}
map<int,int> mp;
for(int i=0;i<7;i++){
for(int it : numbers){
if(!px[i].count(it^fr)){
mp[it] |= (1<<i);
}
}
}
vector<int> res(n);
res[0] = fr;
for(auto [u,v] : mp){
res[v] = u;
}
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |