Pagini recente » Cod sursa (job #2604912) | Cod sursa (job #1050176) | Cod sursa (job #1663482) | Cod sursa (job #1039761) | Cod sursa (job #3032266)
#include <bits/stdc++.h>
using ll=long long;
#define S second
#define F first
#define endl '\n'
#define spid ios_base::sync_with_stdio(false);cin.tie(NULL);
const int mod=1e9+7;
const double pi=3.14159265359;
const int maxn=200001;
using namespace std;
int n;
int main(){
cin>>n;
int l=1,r=n;
int mid,last=0;
while(l<r){
mid=(l+r)/2;
cout<<"? "<<mid<<endl;
int x;
cin>>x;
if(x){
r=mid;
}
else l=mid+1;
}
cout<<"! "<<l<<endl;
}