Language: C++

#include<bits/stdc++.h>
#define mo 1000000007
#define pi 3.1415926535898
#define eps 1e-9 
using namespace std;
long long read(){#include<bits/stdc++.h>
#define mo 1000000007
#define pi 3.1415926535898
#define eps 1e-9 
using namespace std;
long long read(){
    long long xx=0,flagg=1;
    char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-')
        ch=getchar();
    if(ch=='-'){
        flagg=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        xx=xx*10+ch-'0';
        ch=getchar();
    }
    return xx*flagg;
}
void pus(long long xx,long long flagg){
    if(xx<0){
        putchar('-');
        xx=-xx;
    }
    if(xx>=10)
        pus(xx/10,0);
    putchar(xx%10+'0');
    if(flagg==1)
        putchar(' ');
    if(flagg==2)
        putchar('\n');
    return;
}
long long i,l,r,mid,min1,y;
char s[15];
void query(long long x){
	printf("? %lld\n",x);
	fflush(stdout);
	scanf("%s",s);
}
int main(){
	//freopen("camp.in","r",stdin);
	//freopen("camp.out","w",stdout);
	y=1000000000;
	query(y);
	if(s[0]=='Y'){
		i=9;
        while(i){
            query(y-1);
            if(s[0]!='Y')
            	break;
            y/=10;
            i--;
        }
        cout<<"! "<<y<<endl;
        return 0;
    }
	for(i=1;;i=i*10){
		query(i);
		if(s[0]=='N'){
			i/=10;
			l=i;
			r=i*10-1;
			mid=(l+r)/2;
			break;
		}
	}
	min1=r+1;
	while(l<=r){
		query(mid*10);
		if(s[0]=='Y'){
			min1=min(min1,mid);
			r=mid-1;
		}
		else
			l=mid+1;
		mid=(l+r)/2;
	}
	cout<<"! "<<min1<<endl;
	return 0;
}
    long long xx=0,flagg=1;
    char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-')
        ch=getchar();
    if(ch=='-'){
        flagg=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        xx=xx*10+ch-'0';
        ch=getchar();
    }
    return xx*flagg;
}
void pus(long long xx,long long flagg){
    if(xx<0){
        putchar('-');
        xx=-xx;
    }
    if(xx>=10)
        pus(xx/10,0);
    putchar(xx%10+'0');
    if(flagg==1)
        putchar(' ');
    if(flagg==2)
        putchar('\n');
    return;
}
long long i,l,r,mid,min1,y;
char s[15];
void query(long long x){
	printf("? %lld\n",x);
	fflush(stdout);
	scanf("%s",s);
}
int main(){
	//freopen("camp.in","r",stdin);
	//freopen("camp.out","w",stdout);
	for(i=1;;i=i*10){
		query(i);
		if(s[0]=='N'){
			i/=10;
			l=i;
			r=i*10-1;
			mid=(l+r)/2;
			break;
		}
	}
	min1=r+1;
	while(l<=r){
		query(mid*10);
		if(s[0]=='Y'){
			min1=min(min1,mid);
			r=mid-1;
		}
		else
			l=mid+1;
		mid=(l+r)/2;
	}
	cout<<"! "<<min1<<endl;
	return 0;
}

Compiler output:
a.cc:6:18: error: stray '#' in program
    6 | long long read(){#include<bits/stdc++.h>
      |                  ^
a.cc: In function 'long long int read()':
a.cc:6:19: error: 'include' was not declared in this scope
    6 | long long read(){#include<bits/stdc++.h>
      |                   ^~~~~~~
a.cc:6:27: error: 'bits' was not declared in this scope
    6 | long long read(){#include<bits/stdc++.h>
      |                           ^~~~
a.cc:6:32: error: 'stdc' was not declared in this scope; did you mean 'std'?
    6 | long long read(){#include<bits/stdc++.h>
      |                                ^~~~
      |                                std
a.cc:10:1: error: expected primary-expression before 'using'
   10 | using namespace std;
      | ^~~~~
a.cc:11:15: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   11 | long long read(){
      |               ^~
a.cc:11:15: note: remove parentheses to default-initialize a variable
   11 | long long read(){
      |               ^~
      |               --
a.cc:11:15: note: or replace parentheses with braces to value-initialize a variable
a.cc:11:17: error: a function-definition is not allowed here before '{' token
   11 | long long read(){
      |                 ^
a.cc:26:39: error: a function-definition is not allowed here before '{' token
   26 | void pus(long long xx,long long flagg){
      |                                       ^
a.cc:42:24: error: a function-definition is not allowed here before '{' token
   42 | void query(long long x){
      |                        ^
a.cc:47:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   47 | int main(){
      |         ^~
a.cc:47:9: note: remove parentheses to default-initialize a variable
   47 | int main(){
      |         ^~
      |         --
a.cc:47:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:47:11: error: a function-definition is not allowed here before '{' token
   47 | int main(){
      |           ^