#include "interactive.h"
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define pb push_back
#define all(a) a.begin(), a.end()
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
vi guess(int n)
{
vi ans(n);
ans[0] = ask(1);
map<int, int> mp;
for (int i = 0; i < 6; ++i) {
vi v;
for (int j = 2; j <= n; ++j) {
if (1 << i & j) {
v.pb(j);
}
}
vi get = get_pairwise_xor(v);
v.pb(1);
vi Get = get_pairwise_xor(v);
map<int, int> cnt;
for (int j : Get) {
cnt[j]++;
}
for (int j : get) {
cnt[j]--;
}
for (auto j : cnt) {
if(j.x && j.y) {
mp[j.x ^ ans[0]] |= 1 << i;
}
}
}
for (auto i : mp) {
ans[i.y - 1] = i.x;
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
200 KB |
Not correct size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
328 KB |
Output is not correct |
2 |
Halted |
0 ms |
0 KB |
- |