# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
635185 | Bruteforceman | Xoractive (IZhO19_xoractive) | C++11 | 6 ms | 472 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 <bits/stdc++.h>
#include "interactive.h"
using namespace std;
vector<int> ans;
map<int, int> pos;
vector<int> guess(int n) {
ans.assign(n, 0);
ans[0] = ask(1);
int logN = 31 - __builtin_clz(n);
//cerr << logN << '\n';
for (int b = 0; b <= logN; b++) {
cerr << b << '\n';
// get the values of ans[0] ^ ... for the indices whose b-th bit is on
// by inserting 1 to said set of indices
multiset<int> bitval;
vector<int> toQuery, queryAns;
for (int i = 2; i <= n; i++) {
if (i & (1 << b)) {toQuery.push_back(i);}
}
toQuery.push_back(1);
queryAns = get_pairwise_xor(toQuery);
for (auto &i : queryAns) {bitval.insert(i);}
toQuery.pop_back();
queryAns = get_pairwise_xor(toQuery);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |