#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Not correct size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
600 KB |
Output is not correct |
2 |
Halted |
0 ms |
0 KB |
- |