# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
202391 | klungs | 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 <bits/stdc++.h>
using namespace std;
vector <int> ans;
vector<int> contains(vector<int> q) {
vector<int> qf = q;
qf.push_back(1);
auto res1 = get_pairwise_xor(qf);
auto res2 = get_pairwise_xor(f);
set<int> gg (res1.begin(), res1.end());
for (auto x : res2) gg.erase(res2);
return vector<int>(gg.begin(), gg.end());
}
vector<int> guess(int n) {
ans.resize(n + 1);
ans[1] = ask(1);
vector<int> questions[7], answers[7];
for (int i = 2; i <= n; i++) {
for (int j = 0; j < 7; j++) if ((1 << j) & i) {
questions[j].push_back(i);
}
}
map<int, int> id;
for (int j = 0; j < 7; j++) {
answers[j] = contains(questions[j]);
for (int x : answers[j]) {
id[x] ^= (1 << j);
}
}
for (auto x : id) {
ans[x.second] = x.first;
}
// for (int i = 1; i <= n; i++) {
// int num = ask(i);
// cnt[num]++;
// ans.push_back(num);
// // assert(cnt[num] <= 1);
// }
return ans;
}