题意:可以有两次询问,每次给出100个不同的数,返回特定值与其中一个值的异或值,要求猜出特定值x<2^14
思路:两次询问,将x的binary划分为两段,一次询问前半段的值,一次询问后半段的值。(询问binary通过使得查询数组中该区段的位都为0实现),注意将两次查询返回值中的"无效位"(即非查询位删除)
#include<iostream>
#include<cstring>
#include<cstdio>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<algorithm>
#include<string>
#include<bitset>
#include<cmath>
#include<array>
#include<atomic>
#include<sstream>
#include<stack>
#include<iomanip>
//#include<bits/stdc++.h>
//#define int ll
#define IOS std::ios::sync_with_stdio(false);std::cin.tie(0);
#define pb push_back
#define endl '\n'
#define x first
#define y second
#define Endl endl
#define pre(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,b,a) for(int i=b;i>=a;i--)
#define si(x) scanf("%d", &x);
#define sl(x) scanf("%lld", &x);
#define ss(x) scanf("%s", x);
#define YES {puts("YES");return;}
#define NO {puts("NO"); return;}
#define all(x) x.begin(),x.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<int, PII> PIII;
typedef pair<char, int> PCI;
typedef pair<int, char> PIC;
typedef pair<double, double> PDD;
typedef pair<ll, ll> PLL;
const int N = 300010, M = 2 * N, B = N, MOD = 998244353;
const double eps = 1e-7;
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
//int dx[4] = { -1,0,1,0 }, dy[4] = { 0,1,0,-1 };
int n, m, k;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lowbit(ll x) { return x & -x; }
ll qmi(ll a, ll b, ll MOD) {
ll res = 1;
while (b) {
if (b & 1) res = res * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return res;
}
inline void init() {}
void slove()
{
cout << "? ";
pre(i, 1, 100)cout << i << ' ';
cout << endl;
fflush(stdout);
int res1;
cin >> res1;
for (int i = 0; i <= 6; i++)
if (res1 >> i & 1)res1 -= 1 << i;
cout << "? ";
pre(i, 1, 100)cout << (i<<7) << ' ';
cout << endl;
fflush(stdout);
int res2;
cin >> res2;
for (int i = 7; i <= 14; i++)
if (res2 >> i & 1)res2 -= 1 << i;
cout << "! " << res1 + res2 << endl;
}
signed main()
{
//IOS;
int _ = 1;
//si(_);
init();
while (_--)
{
slove();
}
return 0;
}
/*
*/