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;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define f first
#define s second
#define uint unsigned int
#define all(vc) vc.begin(), vc.end()
vector<int> guess(int n)
{
vector<int> ans;
ans.resize(n);
ans[0] = ask(1);
vector<vector<int>> goodPoses(7);
for (int i = 1; i < n; ++i)
for (int bit = 0; bit < 7; ++bit)
if (i & (1 << bit))
goodPoses[bit].pb(i + 1);
map<int, int> poses;
for (int bit = 0; bit < 7; ++bit)
{
vector<int> x = get_pairwise_xor(goodPoses[bit]);
goodPoses[bit].pb(1);
vector<int> y = get_pairwise_xor(goodPoses[bit]);
map<int, int> cnt;
cnt[0]--;
for (auto el : y)
cnt[el]--;
vector<int> vals;
for (auto el : x)
{
cnt[el]++;
if (cnt[el])
poses[el ^ ans[0]] += (1 << bit);
}
}
for (auto [v, pos] : poses)
ans[pos] = v;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |