Pagini recente » Cod sursa (job #29635) | Cod sursa (job #1467651) | Cod sursa (job #3005621) | Cod sursa (job #2542351) | Cod sursa (job #2937183)
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <vector>
#include <stack>
#include <map>
using namespace std;
long long sveps[100005];
long long cu[100005];
long long mata[100005];
long long fre[400005];
long long stop[400005];
map<long long,int>mp;
int main()
{
long long n,i,j,k,l,z,m,a,b,t=1,cnt,suma=0,h,poz1,poz2,x,y,c,d,c1,c2,nra,nrc,maxim,sol,imp,cop,cate,noi,rest;
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s,curr;
char ch;
t=1;
cin>>t;
vector<int>vec;
long long op;
for(op=1; op<=t; op++)
{
cin>>x;
cnt=0;
rest=0;
for(i=1;i<=29;i++)
{
cout<<"? "<<cnt+(1<<i)<<" "<<cnt+(1<<(i+1))<<endl<<endl,cout.flush();
cin>>a;
if(a%(1<<i)==0)
{
cnt=(1<<(i+1))-rest;
}
else
{
rest=rest+(1<<(i-1));
cnt=(1<<(i+1))-rest;
}
}
cout<<"! "<<rest<<endl<<endl,cout.flush();
}
return 0;
}