https://codeforces.com/problemset/problem/1207/E
思路:
14位,第一个集合,后7为全放0.
第二个集合,前7位放0.
对于询问得到的答案,取第一个的后7位,第二个的前7位。
#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=2e5+1000;
typedef long long LL;
inline LL read(){LL x=0,f=1;char ch=getchar(); while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
int main(void){
vector<LL>v1;
for(LL i=1;i<=100;i++){
LL x=0;
x<<7;
x+=i;
v1.push_back(x);
}
vector<LL>v2;
for(LL i=1;i<=100;i++){
LL x=0;
x+=(i<<7);
v2.push_back(x);
}
cout<<"? "<<endl;
for(auto i:v1){
cout<<i<<" ";
}
cout<<endl;
LL num1;cin>>num1;
cout<<"? "<<endl;
for(auto i:v2){
cout<<i<<" ";
}
cout<<endl;
LL num2;cin>>num2;
LL ans=0;
for(LL i=7;i<=14;i++){
ans+=(num1&(1<<i) );
}
for(LL i=0;i<7;i++){
ans+=(num2&(1<<i) );
}
cout<<"! "<<ans<<endl;
return 0;
}