# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
370955 | casperwang | Xoractive (IZhO19_xoractive) | C++14 | 3 ms | 512 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>
#define pb push_back
using namespace std;
#define debug(args...) kout("[ " + string(#args) + " ]", args)
void kout() { cerr << endl; }
template <class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ',kout(b...); }
template <class T> void pary(T L, T R) { while (L != R) cerr << *L << " \n"[++L==R]; }
const int MAXN = 100;
int n;
vector <int> ans;
map <int,int> pos;
vector<int> guess(int N) {
ans.clear(), ans.resize(N);
ans[0] = ask(1);
for (int i = 0; (1<<i) < N; i++) {
vector <int> G;
for (int j = 1; j <= N-1; j++)
if (j & (1<<i)) G.pb(j+1);
vector <int> exp = get_pairwise_xor(G);
G.pb(1);
vector <int> all = get_pairwise_xor(G);
int j = 0;
for (int k = 0; k < exp.size(); k++, j++)
while (all[j] != exp[k])
pos[all[j++] ^ ans[0]] |= (1<<i);
while (j < all.size())
pos[all[j++] ^ ans[0]] |= (1<<i);
}
for (auto [v, p] : pos)
if (v != ans[0])
ans[p] = v;
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |