# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
519843 | Dasha_Gnedko | Xoractive (IZhO19_xoractive) | C++17 | 5 ms | 456 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
#define F first
#define S second
#define sz(a) int32_t(a.size())
using namespace std;
vector < int > guess(int n)
{
vector < int > a(n);
a[0] = ask(1);
if (n == 1) return a;
map < int, int > zn;
for(int j = 0; j < 7; j++)
{
vector < int > b;
for(int i = 1; i < n; i++)
if (i & (1 << j)) b.pb(i + 1);
if (sz(b) == 0) continue;
vector < int > ve = get_pairwise_xor(b);
b.pb(1);
vector < int > ve2 = get_pairwise_xor(b);
b.pop_back();
map < int, int > mp;
for(auto to: ve2)
mp[to]++;
for(auto to: ve)
mp[to]--;
mp[0]--;
for(auto to: mp)
if (to.S) zn[to.F] += (1 << j);
}
for(auto to: zn)
a[to.S] = to.F;
for(int i = 1; i < n; i++)
a[i] ^= a[0];
return a;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |