criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n=1e9;char s[10];
void query(int x){printf("? %d\n",x);fflush(stdout);scanf("%s",s);}
int read(){
    int x=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
    while(isdigit(ch)){x=x*10+ch-48;ch=getchar();}
    return x*f;
}
int main(){
	while(1){
		query(n);
		if(s[0]=='Y') break;
		else n/=10;
	}int base=n,now=n+base;
	while(1){
		query(now);
		if(s[0]=='N') now-=base,base/=10;
		if(!base) break; now+=base;
	}prinf("! %d\n",now);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: 'prinf' was not declared in this scope; did you mean 'printf'?
   22 |         }prinf("! %d\n",now);
      |          ^~~~~
      |          printf
Language: C++

/*Program from Luvwgyx*/
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char s[10];
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
void print(int x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)print(x/10);
    putchar(x%10+'0');
}
void write(int x){print(x);puts("");}
void query(int x){printf("? %d\n",x);fflush(stdout);scanf("%s",s);}
int main()
{
    int x=1e9;query(x);
    if (s[0]=='Y')
    {
        for(int i=9;i;i--)
        {
            query(x-1);
            if (s[0]=='N') break;
            x/=10;
        }
        printf("! %d\n",x);
        return 0;
    }
    for (int i=9;i;i--)
    	{
        x/=10;
        query(x);
        if (s[0]=='Y')
        {
            break;
        }
    }
    int l=x+1,r=x*10-1,ans;
    while(l<=r)
    {
        ll mid=(l+r)>>1;
        query(mid*10);
        if (s[0]=='Y') ans=mid,r=mid-1;
        else l=mid+1;
    }
    printf("! %d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'll' was not declared in this scope; did you mean 'l'?
   46 |         ll mid=(l+r)>>1;
      |         ^~
      |         l
a.cc:47:15: error: 'mid' was not declared in this scope
   47 |         query(mid*10);
      |               ^~~
Language: C++

/*Program from Luvwgyx*/
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char s[10];
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
void print(int x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)print(x/10);
    putchar(x%10+'0');
}
void write(int x){print(x);puts("");}
void query(int x){printf("? %lld\n",x);fflush(stdout);scanf("%s",s);}
int main(){
    int x=1e9;query(x);
    if (s[0]=='Y'){
        for (int i=8;i;i--){
            query(x-1);
            if(s[0]=='N'){printf("! %lld\n",x);return 0;}
            x/=10;
        }
    }
    for (int i=8;i;i--){
        x/=10;query(x);
        if (s[0]=='Y')break;
    }int l=x+1,r=x*10-1,ans;
    while(l<=r){
        ll mid=(l+r)>>1;
        query(mid*10);
        if (s[0]=='Y') ans=mid,r=mid-1;
        else l=mid+1;
    }
    printf("! %lld\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'll' was not declared in this scope; did you mean 'l'?
   34 |         ll mid=(l+r)>>1;
      |         ^~
      |         l
a.cc:35:15: error: 'mid' was not declared in this scope
   35 |         query(mid*10);
      |               ^~~
Language: C++

/*Program from Luvwgyx*/
#include<cstdio>
#include<cstring>
#include<algorithm>
#define int long long
using namespace std;
char s[10];
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
void print(int x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)print(x/10);
    putchar(x%10+'0');
}
void write(int x){print(x);puts("");}
void query(int x){printf("? %lld\n",x);fflush(stdout);scanf("%s",s);}
signed main()
{
    int x=1000000000;
    query(x);
    if (S[0]=='Y')
    {
        for (int i=8;~i;i--)
        {
            query(x-1);
            if (S[0]=='N') break;
            x/=10;
        }
        printf("! %d\n",x);
        return 0;
    }
    for (int i=8;~i;i--)
    	{
        x/=10;
        query(x);
        if (S[0]=='Y')
        {
            len=i+1;
            break;
        }
    }
    int l=x+1,r=x*10-1;
    while(l<=r)
    {
        ll mid=(l+r)>>1;
        query(mid*10);
        if (S[0]=='Y') ans=mid,r=mid-1;
        else l=mid+1;
    }
    printf("! %d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'S' was not declared in this scope
   25 |     if (S[0]=='Y')
      |         ^
a.cc:40:13: error: 'S' was not declared in this scope
   40 |         if (S[0]=='Y')
      |             ^
a.cc:42:13: error: 'len' was not declared in this scope; did you mean 'mblen'?
   42 |             len=i+1;
      |             ^~~
      |             mblen
a.cc:49:9: error: 'll' was not declared in this scope; did you mean 'l'?
   49 |         ll mid=(l+r)>>1;
      |         ^~
      |         l
a.cc:50:15: error: 'mid' was not declared in this scope
   50 |         query(mid*10);
      |               ^~~
a.cc:51:13: error: 'S' was not declared in this scope
   51 |         if (S[0]=='Y') ans=mid,r=mid-1;
      |             ^
a.cc:51:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   51 |         if (S[0]=='Y') ans=mid,r=mid-1;
      |                        ^~~
      |                        abs
a.cc:54:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |     printf("! %d\n",ans);
      |                     ^~~
      |                     abs
Language: C++

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define rep(i,a) for(int i=0; i<a; i++)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

bool check(ll n){
    cout2("?",n);
    char c; cin>>c;
    return (c=='Y');
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll num=1000000000;
    while(num&&!c(num)) num/=10;
    
    if(num!=1000000000){
        ll lb=num*10, ub=lb*10-1, mid;
        while(ub-lb>1){
            mid=(ub+lb)/2;
            if(check(mid)) ub=mid;
            else lb=mid;
        }
        ll ans=lb;
        if(!check(ans))ans++;
        cout2("!",ans/10);
    }else{
        ll ans=9;
        while(!check(ans)) ans*=10;
        cout2("!",ans/9);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:17: error: 'c' was not declared in this scope
   45 |     while(num&&!c(num)) num/=10;
      |                 ^
Language: C++

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define rep(i,a) for(int i=0; i<a; i++)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

bool check(ll n){
    cout2("?",n);
    char c; cin>>c;
    return (c=='Y');
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll num=1000000000;
    while(num&&!c(num)) num/=10;
    
    if(num!=1000000000){
        ll lb=num*10, ub=lb*10-1, mid;
        while(ub-lb>1){
            mid=(ub+lb)/2;
            if(check(mid)) ub=mid;
            else lb=mid;
        }
        ll ans=lb;
        if(!check(ans))ans++;
        cout2("!",ans/10);
    }else{
        ll ans=9;
        while(!check(ans)) ans*=10;
        cout2("!",ans/9);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:17: error: 'c' was not declared in this scope
   45 |     while(num&&!c(num)) num/=10;
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	char a;
	int i=10;
	while(i--){
		if(i==0){
			cout<<"! 1";
			fflush(0);
			return 0;
		}
		cout<<"? "<<(int)pow(10,i)-1<<"\n";
		fflush(0);
		cin>>a;
		if(a=='N'){
			break;
		}
	}
	int l=(int)pow(10,i+1),r=(int)pow(10,i+2)-1;
	while(l<r){
		int mid=(l+rYYYYYYY)/2;
		cout<<"? "<<(int)mid<<"\n";
		fflush(0);
		cin>>a;
		if(a=='N')	l=mid+1;
		else	r=mid;
	}
	cout<<"! "<<l/10;
	fflush(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: 'rYYYYYYY' was not declared in this scope
   22 |                 int mid=(l+rYYYYYYY)/2;
      |                            ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1061109567
#define pb push_back
#define in(s) freopen(s,"r",stdin);
#define out(s) freopen(s,"w",stdout);
#define fi first
#define se second
#define bw(i,r,l) for (int i=r-1;i>=l;i--)
#define fw(i,l,r) for (int i=l;i<r;i++)
#define fa(i,x) for (auto i:x)
using namespace std;
int cnt=0,val=0;
void ask() {
	int beg=0; if (val==0) beg=1;
	fw (i,beg,10) {
		cout<<val*10+i<<endl<<flush;
		char temp;
		cin>>temp;
		if (temp=='Y')
	}
}
int fpow(int a,int p) {
	int ans=1;
	fw (i,0,p) ans*=a;
	return ans;
}
signed main() {
	//in("aome.inp");
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	/*
	How to get the number of digits N have?
	Keep asking queries of 1e9 down to 1. Let's say N have k digits. Then 1e(k + 1) will return N and
	1ek will return Y.
	k have been found. Now, binary search on this range simply.
	Query for mid:
	mid <= N. How to ask?
	We can see, mid * 10 > N with all possible mids. Also, it's the same as mid when comparing as
	strings. So the relations can be found.
	If we receive a Y, mid > N. Else, mid <= N
	*/
	int cur=9;
	for (int i=1e9;i>=1;i/=10) {
		cout<<"? "<<i<<endl<<flush;
		char temp;
		cin>>temp;
		if (temp=='Y') {cnt=cur; break;}
		cur--;
	}
	int l=fpow(cnt-1),r=fpow(cnt)-1;
	while (l<r) {
		int mid=(l+r)>>1;
		cout<<"? "<<mid*10<<endl<<flush;
		char temp;
		cin>>temp;
		if (temp=='Y') r=mid-1;
		else l=mid+1;
	}
	cout<<"! "<<l<<endl<<flush;
	return 0;
}

Compiler output:
a.cc: In function 'void ask()':
a.cc:21:9: error: expected primary-expression before '}' token
   21 |         }
      |         ^
a.cc: In function 'int main()':
a.cc:50:19: error: too few arguments to function 'int fpow(int, int)'
   50 |         int l=fpow(cnt-1),r=fpow(cnt)-1;
      |               ~~~~^~~~~~~
a.cc:23:5: note: declared here
   23 | int fpow(int a,int p) {
      |     ^~~~
a.cc:51:18: error: 'r' was not declared in this scope
   51 |         while (l<r) {
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define int long long
signed main()
{
	int x = 1;
	for(; x <= 10 ; ++x)
		cout << "? " << pow(10, x) << endl;
		fflush(stdout);
		char a;
		cin >> a;
		if(a == 'N'){
			x--;
			break;
		}
	}
	int l = pow(10, x), r = pow(10, x + 1) - 1;
	while(l != r){
		int mid = (l + r) / 2;
		cout << "? " << mid * 10 << endl;
		fflush(stdout);
		char a;
		cin >> a;
		if(a == 'N') l = mid + 1;
		else r = mid;
	}
	cout << "! " << l;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: break statement not within loop or switch
   15 |                         break;
      |                         ^~~~~
a.cc: At global scope:
a.cc:18:25: error: 'x' was not declared in this scope
   18 |         int l = pow(10, x), r = pow(10, x + 1) - 1;
      |                         ^
a.cc:19:9: error: expected unqualified-id before 'while'
   19 |         while(l != r){
      |         ^~~~~
a.cc:28:9: error: 'cout' does not name a type
   28 |         cout << "! " << l;
      |         ^~~~
a.cc:29:9: error: expected unqualified-id before 'return'
   29 |         return 0;
      |         ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <algorithm>
#include <string>
#include <climits>
#include <cmath>
#include <cstdlib>
#include "grader.h"

using namespace std;

string num = "";

char ask(string str)
{
	char ch;
    cout << "? " << str << endl << flush;
    cin >> ch;
    return ch;
}

void answer(string str)
{
    cout << "! " << str << endl << flush;
    exit(0);
}

bool check(char digit)
{
    if (digit == '9') return true;
    string tmp = num + digit;
    tmp.append(15 - tmp.size(), '9');
    bool res = (ask(tmp) == 'Y');
//    cerr << tmp << ": " << res << endl;
    return res;
}

int getceil(char l, char r)
{
    while (r > l) {
        char m = (l + r) / 2;
        if (check(m)) r = m;
        else l = m+1;
//        cerr << l << ' ' << r << endl;
    }
    return r;
}

int solve()
{
    string str = "1";
    while (ask(str) == 'Y') {
		str += '0';
    }
    int numdigits = str.size() - 1;


    num += getceil('1', '9');
    for (int i = 1; i < numdigits; ++i) {
        num += getceil('0', '9');
    }
    answer(num);
	return 0;
}

int main()
{
    return solve();
}


Compiler output:
a.cc:10:10: fatal error: grader.h: No such file or directory
   10 | #include "grader.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
int pw[22];
signed main(){
	pw[0] = 1;
	char v;
	int s;
	for(int i = 1 ; i <=10 ; ++i) pw[i] = pw[i - 1] * 10;
	for(int i = 10 ; i >= 1 ; --i)
	{
		int check = pw[i] - 1;
		cout << "? " << check;
		fflush(stdout);
		cin >> v;
		if(v == "N") 
		{
			s = i;
			break;
		}
	}
	int l = pw[i] , r = pw[i + 1] - 1;
	while(l < r)
	{
		int mid = l + r >> 1;
		cout << "? " << mid;
		fflush(stdout);
		cin >> v;
		if(v == "Y") r = mid;
		else l = mid + 1; 
	}
	cout << "! " << l;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |                 if(v == "N")
      |                    ~~^~~~~~
a.cc:22:20: error: 'i' was not declared in this scope
   22 |         int l = pw[i] , r = pw[i + 1] - 1;
      |                    ^
a.cc:23:19: error: 'r' was not declared in this scope
   23 |         while(l < r)
      |                   ^
a.cc:29:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |                 if(v == "Y") r = mid;
      |                    ~~^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <algorithm>
#include <string>
#include <climits>
#include <cmath>
#include <cstdlib>
#include "grader.h"

using namespace std;

string num = "";

char ask(string str)
{
	char ch;
    cout << "? " << str << endl << flush;
    cin >> ch;
    return ch;
}

void answer(string str)
{
    cout << "! " << str << endl << flush;
    exit(0);
}

bool check(char digit)
{
    if (digit == '9') return true;
    string tmp = num + digit;
    tmp.append(15 - tmp.size(), '9');
    bool res = (ask(tmp) == 'Y');
//    cerr << tmp << ": " << res << endl;
    return res;
}

int getceil(char l, char r)
{
    while (r > l) {
        char m = (l + r) / 2;
        if (check(m)) r = m;
        else l = m+1;
//        cerr << l << ' ' << r << endl;
    }
    return r;
}

int solve()
{
    while (true) {
        // maybe already true
        if (num.size() > 0) {
			bool full9 = 1;
			for (int i = 0; i < num.size(); ++i) {
				if (num[i] != '9') {
					full9 = 0;
					break;
				}
			}

			if (full9) {
				char ch = ask("1" + string(num.size(), '0'));
                if (ch == 'N') answer(num);
			} else {
                char ch = ask(to_string( stoll(num) + 1 ));
                if (ch == 'Y') answer(num);
			}
        }

        // binary search
        num += getceil('0', '9');
	}
	return 0;
}

int main()
{
    return solve();
}


Compiler output:
a.cc:10:10: fatal error: grader.h: No such file or directory
   10 | #include "grader.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define int long long
const double PI = 3.14159265358979323846;
typedef vector<int> vint;
typedef pair<int, int> P;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int val(vint x) {
    int res = x[0];
    for (int i = 1; i < x.size(); i++) (res *= 10) += x[i];
    return res;
}

signed main() {
    vint ans;
    for (int i = 0; i <= 10; i++) ans.push_back(0);
    for (int i = 0; i < 1; i++) {
        cout << "? 10000000000" << endl;
        char a;
        cin >> a;
        if (a == 'N') break;
        vint cmp;
        for (int j = 0; j < 10; j++) cmp.push_back(1);
        for (int j = 10; j > 0; j--) {
            cout << "? " << val(cmp) << endl;
            char a;
            cin >> a;
            if (a == 'N') {
                ans[0] = 1;
                ans.resize(j + 1);
                cout << "! " << val(ans) << endl;
                return 0;
            }
            cmp.pop_back();
        }
        cout << "? 2" << endl;
        char a;
        cin >> a;
        if (a == 'Y')
            cout << "! 1" << endl;
        else
            cout << "! 10" << endl;
        return 0;
    }
    for (int i = 0; i < ans.size() - 1; i++) {
        int lb = 0, ub = 10;
        while (ub - lb > 1) {
            int mid = (lb + ub) / 2;
            ans[i] = mid;
            cout << "? " << val(ans) << endl;
            char a;
            cin >> a;
            if (a == 'Y') {
                ub = mid;
            } else {
                lb = mid;
            }
        }
        ans[i] = lb;
    }
    for (int i = ans.size() - 2; i >= 0; i--) {
        if (ans[i] == 9)
            ans[i] = 0;
        else {
            ans[i]++;
            break;
        }
    }
    vint cmp;
    cmp.push_back(1);
    for (int i = 1; i < ans.size(); i++) cmp.push_back(0);
    for (int i = ans.size(); i >= 0; i--) {
        cout << "? " << val(cmp) << endl;
        char a;
        cin >> a;
        if (a == 'Y') {
            ans.resize(i);
            break;
        }
        cmp.pop_back();
    }
    cout << "! " << val(ans) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:14: error: redeclaration of 'char a'
   40 |         char a;
      |              ^
a.cc:22:14: note: 'char a' previously declared here
   22 |         char a;
      |              ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
main()
{
	char s[2];
	int now,k=1;
	for(now=1;now<=10;now++,k*=10)
	{
		printf("? %d\n",k);
		fflush(stdout);
		scanf("%s",s);
		if(s[0]=='N')break;
	}
	now--;
	if(now==10)
	{
		k=2;
		for(now=1;now<=10;now++,k*=10)
		{
			printf("? %d\n",k);
			fflush(stdout);
			scanf("%s",s);
			if(s[0]=='Y'){printf("! %d",k/2);fflush(stdout);return;}
		}
	}
	else
	{
		int l=k/10+1,r=k-1;
		while(l<=r)
		{
			if(l==r-1)
			{
				printf("? %lld\n",(long long)l*10);
				fflush(stdout);
				scanf("%s",s);
				if(s[0]=='Y'){printf("! %d",l);fflush(stdout);return;}
				else {printf("! %d",r);fflush(stdout);return;}
			}
			int mid=l+r>>1;
			printf("? %lld\n",(long long)mid*10);
			fflush(stdout);
			scanf("%s",s);
			if(s[0]=='Y')r=mid;
			else l=mid+1;
		}
	}
	return 0;
}
//1.控制字典序一定小  1,10,100...， 来确定数字位数或是不是10的次幂
//2.找出位数后，控制数字一定大， 二分ans，给交互库ans*10，比较字典序来确定数字 

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:24:73: error: return-statement with no value, in function returning 'int' [-fpermissive]
   24 |                         if(s[0]=='Y'){printf("! %d",k/2);fflush(stdout);return;}
      |                                                                         ^~~~~~
a.cc:37:79: error: return-statement with no value, in function returning 'int' [-fpermissive]
   37 |                                 if(s[0]=='Y'){printf("! %d",l);fflush(stdout);return;}
      |                                                                               ^~~~~~
a.cc:38:71: error: return-statement with no value, in function returning 'int' [-fpermissive]
   38 |                                 else {printf("! %d",r);fflush(stdout);return;}
      |                                                                       ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;

// #undef DEBUG
// #define DEBUG
/// {{{ DEBUG --- ///
template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { if(&o == &cerr) { o << '{'; for(size_t i = 0; i < v.size(); i++) o << v[i] << (i + 1 != v.size() ? ", " : ""); o << "}"; } else { for(size_t i = 0; i < v.size(); i++) o << v[i] << (i + 1 != v.size() ? " " : ""); } return o; }
#ifdef DEBUG
#define dump(...) (cerr<<"["<<__LINE__<< "] "<<#__VA_ARGS__<<" = "<<make_tuple(__VA_ARGS__)<<"\n")
template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":", ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream &o, tuple<T...> const &t){ o << "("; _ot<0>(o, t); o << ")"; return o; }
#else
#define dump(...) (0)
#endif
/// }}}--- ///

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  ll b = 1; for(int i = 0; i < 9; i++) b *= 10;
  ll c = b - 1;
  dump(b, c);
  ll now = 0;
  int all9 = 1;
  ll k = 1;
  int cnt = 0;
  while(1) {
    if(cnt == 9 && now != 1e8) return (cout << now << endl, 0);
    if(cnt == 9) {
      cout << "? " << 9e8 << endl;
      char y; cin >> y;
      cout << "! " << (y == 'Y' ? 1e8 : 1e9) << endl;
      return 0;
    }
    int ok = 9, ng = cnt ? -1 : 0;
    while(ok - ng > 1) {
      ll mid = (ok + ng) >> 1;
      if((now * 10 + mid) * b + c > 1e18) int x=cin>>x;
      assert((now * 10 + mid) * b + c <= 1e18);
      cout << "? " << (now * 10 + mid) * b + c << endl;
      char y; cin >> y;
      if(y == 'Y') {
        ok = mid;
      } else {
        ng = mid;
      }
    }
    dump(ok);
    if(ok == 0) {
      if(all9) {
        dump(k);
        cout << "? " << k << endl;
        char y; cin >> y;
        if(y != 'Y') {
          cout << "! " << now << endl;
          return 0;
        }
      } else {
        dump(k-1);
        cout << "? " << k-1 << endl;
        char y; cin >> y;
        if(y == 'Y') {
          cout << "! " << now << endl;
          return 0;
        }
      }
    }
    all9 &= ok == 9;
    now = now * 10 + ok;
    k *= 10;
    cnt++;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:39:52: error: cannot convert 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' in initialization
   39 |       if((now * 10 + mid) * b + c > 1e18) int x=cin>>x;
      |                                                 ~~~^~~
      |                                                    |
      |                                                    std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
Language: C++

#include <stdio.h>
#pragma warning(disable:4996)
//FILE *in = fopen("input.txt", "r"), *out = fopen("output.txt", "w");
FILE *in = stdin, *out = stdout;
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
#define INF 0x7fffffff
#define NM 100005
#define MOD 1000000007
#define FOR(i,n,m) for (int i=(n);i<=(m);i++)
#define si(n) fscanf(in,"%d",&n)
#define sd(n) fscanf(in,"%lf",&n)
typedef long long int ll;

int ans=123;
char test(ll X) {
	//*
	fprintf(out, "? %lld\n", X);
	char ch[5]; fscanf(in, "%s", ch);
	fflush(stdout);//*/
	return ch[0];
}
void Find(int X) {
	fprintf(out, "! %d\n", X);
}

int getLen() {
	int L = 0, R = 8, len = 9;
	while (L <= R) {
		int m = (L + R) >> 1;
		int X = 1;
		FOR(i, 1, m) X *= 10;
		if (test(X) == 'N') {
			len = min(len, m);
			R = m - 1;
		}
		else {
			L = m + 1;
		}
	}
	/*for (ll X = 1; len < 9; len++, X *= 10) {
		if (test(X) == 'N') {
			return len;
		}
	}*/
	return len;
}
void temp() {
	int a[10005];
	FOR(i, 1, 10000) a[i] = i;
	sort(a + 1, a + 1 + 10000, [](const int& lhs, const int& rhs) {
		char t1[20], t2[20];
		itoa(lhs, t1, 10); itoa(rhs, t2, 10);
		return strcmp(t1, t2)<=0;
	});
	FOR(i, 1, 10000) fprintf(out, "%d\n", a[i]);
}
int main() {
	int len = getLen();
	if (len == 9 && test(1000000000) == 'Y') { // 10^k 꼴 or 9자리
		len = 0;
		for (ll X = 2; len <= 9; len++, X *= 10) {
			char ch = test(X);
			if (ch == 'Y') {
				Find(X / 2);
				return 0;
			}
		}
	}
	int ans = 0;
	FOR(k, 1, len - 1) {
		int L = 0, R = 9, v = 9;
		if (k == 1) L = 1;
		while(L<=R){
			int m = (L + R) >> 1;
			int X = ans * 10 + m;
			if (test(X) == 'N') {
				v = min(v, m - 1);
				R = m - 1;
			}
			else {
				L = m + 1;
			}
		}
		ans = ans * 10 + v;
	}
	{ // last digit
		int L = 0, R = 9, v = -1;
		if (len == 1) L = 1;
		FOR(i, L, R) {
			ll X = ((ll)ans * 10 + i) * 10;
			if (test(X) == 'Y') {
				Find(ans * 10 + i);
				return 0;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:55:17: error: 'itoa' was not declared in this scope
   55 |                 itoa(lhs, t1, 10); itoa(rhs, t2, 10);
      |                 ^~~~
a.cc:56:24: error: 'strcmp' was not declared in this scope
   56 |                 return strcmp(t1, t2)<=0;
      |                        ^~~~~~
a.cc:8:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <math.h>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
bool fuck(char c, ll n) {
	cout << c << " " << n << endl;
	if (c == '?') {
                string s; cin >> s;
		if (s[0] == 'Y') return 1;
		return 0;
	}
}
int main() {
	int len = 1, num = 1;
	while (judge('?', num)) {
		len *= 10; num = len;
	}
	len /= 10; num = len;
	while (len) {
		int l = 0, r = 9;
		while (l < r) {
			int mid = (l + r + 1) >> 1;
			if (judge('?', mid * len + num)) l = mid;
			else r = mid - 1;
		}
		num += l * len;
		len /= 10;
	}
	fuck('!',  num);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'judge' was not declared in this scope
   14 |         while (judge('?', num)) {
      |                ^~~~~
a.cc:22:29: error: 'judge' was not declared in this scope
   22 |                         if (judge('?', mid * len + num)) l = mid;
      |                             ^~~~~
a.cc: In function 'bool fuck(char, long long int)':
a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type]
   11 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<pii,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf=sizeof(Def)==sizeof(long long)?9e18:1e9;
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,1,-1,1,-1};
int main(){
	int t=-1;
	vi in(15);
	in[0]=1;
	rep(i,14)in[i+1]=in[i]*10;
	rep(i,10){
		cout<<"? "<<in[i+1]<<endl;
		char a;cin>>a;
		if(a!='Y'){
			t=i+1;
			break;
		}
	}
	if(t==-1){
		rep(i,11){
			cout<<"? "<<2*in[i]<<endl;
			char a;cin>>a;
			if(a=='Y'){
				t=i+1;
				break;
			}
		}
		cout<<"! "<<in[t-1]<<endl;
		return 0;
	}
	ll l=in[t-1],r=in[t]-1;
	while(r-l>1){
		ll h=(l+r)/2;
		cout<<"? "<<10*h<<endl;
		char a;cin>>a
		if(a=='Y')r=h;
		else l=h;
	}
	cout<<"! "<<r<<endl;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:74:30: error: expected ';' before 'if'
   74 |                 char a;cin>>a
      |                              ^
      |                              ;
   75 |                 if(a=='Y')r=h;
      |                 ~~            
a.cc:76:17: error: 'else' without a previous 'if'
   76 |                 else l=h;
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

long long ans;
char rt1[5],rt3[5];
int main() {
    ans = 1;
    bool flag = true;
    int bits = 1;
    while(true) {
        printf("? %lld", ans);
        for (int i = bits + 1; i <= 17; i++) printf("9");
        puts("");

        //printf("? %lld999999999\n",ans);
        fflush(stdout);x
        scanf("%s",rt1);
        if(rt1[0] == 'Y') {
            printf("? %lld\n",ans+1);
            fflush(stdout);
            scanf("%s",rt3);
            if(ans % 10 != 9) flag = false;
            if(flag && rt3[0] == 'N') break;
            if(!flag && rt3[0] == 'Y') break;
            ans = ans*10;
            bits++;
        } else {
            ans++;
        }
        if(ans >= 1000000000) break;
    }
    printf("! %lld\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: 'x' was not declared in this scope
   17 |         fflush(stdout);x
      |                        ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int cur=MOD-7;
inline bool check(int x){
    cout<<"? "<<x<<endl;
    string res;
    cin>>res;
    return res=="Y";
}
int main(){
    if(check(cur)){
        while(cur>1 && check(cur-1))cur/=10;;
        cout<<"! "<<cur<<endl;
    }
    else{
        while(!check(cur/=10));
        int lb=cur,ub=cur*10;
        while(ub-lb>1){
            int mid=(lb+ub)/2;
            if(check(mid*10))ub=mid;
            else lb=mid;
        }
        cout<<"! "<<ub<<endl;
    }
    return 0;
}

Compiler output:
a.cc:4:9: error: 'MOD' was not declared in this scope
    4 | int cur=MOD-7;
      |         ^~~
Language: C++

#include <bits/stdc++.h>

typedef long long ll;

const ll most = 1e9;

bool query(ll val){
	std::cout << "? " << val << std::endl;
	
	char c;
	std::cin >> c;
	
	return (c == 'Y');
}

int main(){
	ll length = 1;
	
	if(!query(9)){
		for(ll i = 10; i <= most; i *= 10){
			if(query(i * 10 - 1)){
				length = i;
				break;
			}
		}
	}
	
	if(!query(most)){
		for(ll i = most; i >= 1; i /= 10){
			if(query(i)){
				length = i;
				break;
			}
		}
	}
	
	ll l = length;
	ll r = length * 10 - 1;
	
	ll best = r;
	
	while(l <= r){
		ll mid = (l + r) / 2;
		
		if(query(mid * 10)){
			r = mid - 1;
			best = mid;
		} else {
			l = mid + 1;
		}
	}
	
	if(best != target){
		std::cout << target << ' ' << best << std::endl;
		return -1;
	}	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:20: error: 'target' was not declared in this scope
   53 |         if(best != target){
      |                    ^~~~~~
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <tuple>
#include <bitset>
#include <algorithm>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef complex<ld> compd;
#define rep(i,n)	for(int i=0;i<n;i++)
#define srep(i,a,n)	for(int i=a;i<n;i++)
#define REP(i,n)	for(int i=0;i<=n;i++)
#define SREP(i,a,n)	for(int i=a;i<=n;i++)
#define rrep(i,n)	for(int i=n-1;i>=0;i--)
#define RREP(i,n)	for(int i=n;i>=0;i--)
#define all(a)	(a).begin(),(a).end()
#define mp(a,b)	make_pair(a,b)
#define mt	make_tuple
#define fst	first
#define scn second
#define bicnt(x)	__buildin__popcount(x)
#define debug(x)	cout<<"debug: "<<x<<endl

const ll inf = (ll)1e18;
const ll mod = (ll)1e9 + 7;
const ld eps = 1e-18;
const int dx[] = { 0,1,0,-1 };
const int dy[] = { 1,0,-1,0 };

string query(ll k) {
	cout << "? " << k << endl;
	flush();
	string ret;	cin >> ret;
	return ret;
}

void answer(ll k) {
	cout << "! " << k << endl;
	exit(0);
}

int main() {
	ll ans = 1LL;
	while (true) {
		string s = query(ans);
		if (s == "N") {
			ans /= 10;
			break;
		}
		else {
			ans *= 10;
			if (ans > mod) {
				answer(1e9);
				return 0;
			}
		}
	}
	ll left = ans, right = ans * 10 - 1;
	while (left + 3 < right) {
		ll mid = (left + right) / 2;
		string s = query(mid * 10);
		if (s == "Y")	right = mid;
		else	left = mid;
	}
	for (ll i = right; i >= left; i--) {
		string s = query(i * 10);
		if (s == "N") {
			answer(i);
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'std::string query(ll)':
a.cc:49:14: error: no matching function for call to 'flush()'
   49 |         flush();
      |         ~~~~~^~
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:766:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::flush(basic_ostream<_CharT, _Traits>&)'
  766 |     flush(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~~
/usr/include/c++/14/ostream:766:5: note:   candidate expects 1 argument, 0 provided
Language: C++


#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <string>
#include <sstream>

using namespace std;


#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define INF 1<<30
#define mp make_pair
#define pb push_back



typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vp;

typedef long long ll;

int main(){
	int MAX = 64;
	char buffer[sizeof(long) * 8 + 1];
	string n;
	char ans;
	ll mi = pow(10, 17);
	ll ma = pow(10, 18)-1;
	ll mid;
	string check,lcheck;
	rep(i, MAX){
		mid = (mi + ma) / 2;
		_i64toa_s(mid, buffer, sizeof(long) * 8 + 1, 10);
		stringstream s;
		s << buffer;
		string buff = s.str();
		check = buff.substr(0, 10);
		if (check == lcheck && check[9] == '0'){
			break;
		}
		lcheck = check;

		cout << "? " << buffer << endl;
		//cout << "@: " << i+1 << endl;
		cin >> ans;
		if (ans == 'Y'){
			ma = mid;
		} else if(ans=='N'){
			mi = mid;
		}
	}
	ll threshold = mid / pow(10, 8);
	//109 vs 1090 10901 : y y  1091 : y y 110 : y n
	//99 vs 990 9901:y y 991:y y 100: n : y
	//199 VS 1990 19901: y y 1991:y y 200: y n
	ll res = threshold;
	for (int i = 9; 0 < i; i--){
		threshold = 1 + threshold / 10;
		cout << "? " << threshold << endl;
		cin >> ans;
		//99999の時の処理
		if (threshold == pow(10, i)){
			if (ans == 'Y'){
				break;
			}
			if (ans == 'N'){
				res /= 10;
				break;
			}
		} else{
			if (ans == 'N'){
				break;
			}
		}
		res /= 10;
	}
	/*
	_i64toa_s(mid, buffer, sizeof(long) * 8 + 1, 10);
	stringstream s;
	s << buffer;
	string buff=s.str();
	string highest = "";
	string res;
	rep(i,buff.size()-8){
		highest += buff[i];
	}
	for (int i = highest.size() - 1;; i--){
		res = highest.substr(0, i);
		cout << "? " + res << endl;
		cin >> ans;
		if (ans == 'Y'){
			break;
		}
	}*/

	cout << "! ";
	cout << res << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:17: error: '_i64toa_s' was not declared in this scope
   42 |                 _i64toa_s(mid, buffer, sizeof(long) * 8 + 1, 10);
      |                 ^~~~~~~~~
Language: C++

#define _GLIBCXX_DEBUG
#include <iostream>
#include <cstdio>
#include <bits/stdc++.h>//"geometry.cpp"
#include <iomanip>//"cout<<fixed<<setprecision(n)<<sth<<endl;"
#include <queue>
#include <string>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <algorithm>//"lower_bound(it,it,v)", "next_permutation(a,a+n)"
#include <functional>//"greater<T>" Ex. sort(a,a+n,greater<int>());
#include <cmath>//"abs", "sqrt"
using namespace std;
#define pb push_back
#define fi first
#define sc second
#define mp make_pair
#define is insert
typedef pair<int,int> pii;//Add other types in the same way.

bool q(long long n){
	for debuging above
	char ans;
	cout<<"? "<<n<<endl;
	cin>>ans;
	if(ans=='Y') return true;
	else return false;
}

int main(){
	long long m=1;
	for(;m<=1000000000;m*=10){
		if(!q(m)) break;
	}
	if(m==10000000000){
		m=1;
		for(long long i=2;i<=2000000000;i*=10){
			if(q(i)) break;
			m*=10;
		}
		cout<<"! "<<m<<endl;
	}else{
		int lb=m/10,ub=m-1;
		while(ub-lb>1){
			int mid=(lb+ub)/2;
			if(q(10*mid)){
				ub=mid;
			}else{
				lb=mid;
			}
		}
		cout<<"! "<<ub<<endl;
	}
	fflush(stdout);
}

Compiler output:
a.cc: In function 'bool q(long long int)':
a.cc:24:13: error: expected '(' before 'debuging'
   24 |         for debuging above
      |             ^~~~~~~~
      |             (
a.cc:24:13: error: 'debuging' was not declared in this scope
   24 |         for debuging above
      |             ^~~~~~~~
a.cc:27:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |         cin>>ans;
      |              ^~~
      |              abs
a.cc:27:17: error: expected ')' before ';' token
   27 |         cin>>ans;
      |                 ^
      |                 )
a.cc:24:13: note: to match this '('
   24 |         for debuging above
      |             ^~~~~~~~
a.cc:28:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |         if(ans=='Y') return true;
      |            ^~~
      |            abs
a.cc:30:1: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

bool ask(int64_t a){
	cout << "? " << a << endl;
	char c;
	cin >> c;
	return c == 'Y';
}

void ans(int64_t a){
	cout << "! " << a << endl;
}

int main(){
	if(ask(1e9)){
		int64_t a = 2;
		while(!ask(a)) a *= 10;
		ans(a / 2);
	}else{
		int64_t a = 1e8;
		while(!ask(a)) a /= 10;
		int64_t l = a, r = a * 10;
		while(1 < r - l) (ask(mid * 10) ? l : r) = mid;
		ans(l);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:39: error: 'mid' was not declared in this scope
   24 |                 while(1 < r - l) (ask(mid * 10) ? l : r) = mid;
      |                                       ^~~
Language: C++

#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <cmath>
#define ll long long
using namespace std;

void ask(ll x){
	cout << "? " << x << endl;
	fflush(stdout);
}
bool rec(){
	char x;
	cin >> x;
	return (x == 'Y');
}

ll main(){
	//确定N是否为10^k
	bool is10;
	ask(1000000000);
	is10 = rec();
	
	//确定位数
	ll wei = 1;
	if(is10){
		ask(2);
		ll a = 20;
		while(!rec()){
			ask(a);
			a *= 10;
			wei++;
		}
		cout << "! " << a / 20 << endl;
		return 0;
	}
	
	ll l,r,mid;
    for(ll i = 0;i <= 18;i++){
    	ask(pow(10,i));
        if(!rec()){
            l = pow(10,i-1);
            r = pow(10,i);
            break;
        }
    }
 
    while(r - l > 1){
        mid = (l + r) / 2;
        ask(mid * 10);
        if(rec()) r = mid;
        else l = mid;
    }
	
	cout << "! " << r << endl;
	return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18;
const double PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

LL test = 120;
string getString(LL num){
	stringstream ss;
	ss << num;
	return ss.str();
}

bool query(LL num){
	cout << "? " << num << endl;
//*
	string res;
	cin >> res;
	return (res[0]=='Y');
//*/
	string tStr = getString( test );
	string nStr = getString( num );
	bool B1 = false;
	bool B2 = false;
	if( num <= test && nStr <= tStr ){
		B1 = true;
	}
	if( num > test && nStr > tStr ){
		B2 = true;
	}
	return B1^B2;
}
void pow10(){//10^n
	LL base = 2;
	while( query(base) == false ){
		base *= 10;
	}
	cout << "! " << base/2 << endl;
}
void solve(){
	int base = (int)1e9;
	
	if( query( base ) ){
		pow10();
		return;
	}

	//桁数の決定
	int keta = 9;
	base /= 10;
	while( query( base ) == false ){
		--keta;
		base /= 10;
	}

	//最上位桁の決定
	int H,L;
	L = 1;
	H = 10;
	LL ket10 = powMod(10,keta-1);
	LL ans;
	while(H-L>1){
		int mid = (L+H)/2;
		LL temp = mid*ket10;
		if( query( temp*10 ) ){
			H = mid;
		}else{
			L = mid;
		}
	}
	ans = L*ket10;
	--keta;
	ket10 /= 10;
	while( keta ){
		L = 0;
		H = 10;
		while(H-L>1){
			int mid = (L+H)/2;
			LL temp = (ans + mid*ket10) * 10;
			if( query( temp ) ){
				H = mid;
			}else{
				L = mid;
			}
		}
		if( keta > 1 ){
			ans += L * ket10;
		}else{
			ans += H;
		}
		--keta;
		ket10 /= 10;
	}
	cout << "! " << ans << endl;
}
#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()


Compiler output:
a.cc: In function 'void solve()':
a.cc:100:20: error: 'powMod' was not declared in this scope
  100 |         LL ket10 = powMod(10,keta-1);
      |                    ^~~~~~
Language: C++

#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
#include<cstdio>
#include<cassert>
#include<iomanip>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define pi acos(-1)
#define ll long long
#define mod 1000000007
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1
#pragma comment(linker, "/STACK:1024000000,1024000000")

using namespace std;

const double g=10.0,eps=1e-4;
const int N=200000+10,maxn=500+100,inf=0x3f3f3f;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int l=1,r=11;
    string s;
    while(l!=r){
        int m=(l+r)/2;
        if(r-l==1)m=r;
        cout<<"? 1"<<string(m-1,'0')<<endl;
        cout.flush();
        cin>>s;
        if(s[0]=='Y')l=m;
        else r=m-1;
    }
    if(l==11)
    {
        l=1,r=10;
        while(l!=r){
            int m=(l+r)/2;
            if(r-l==1)m=r;
            cout<<"? 1"<<string(t-1,'0')<<endl;
            cout.flush();
            cin>>s;
            if(s[0]=='Y')r=m;
            else l=m+1;
        }
        cout<<"! 1"<<string(l-1,'0')<<endl;
        return 0;
    }
    int ws=l;
  //  cout<<ws<<endl;
    string ans="";
    for(int i=1;i<=ws;i++)
    {
        l=(i==1? 1:0),r=10;
        while(l!=r){
            int m=(l+r)/2;
            cout<<"? "<<ans<<(char)(m+'0')<<string(10-ans.size(),'9')<<endl;
            cout.flush();
            cin>>s;
            if(s[0]=='N')l=m+1;
            else r=m;
        }
        ans+=(char)(l+'0');
    }
    cout<<"! "<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:33: error: 't' was not declared in this scope
   47 |             cout<<"? 1"<<string(t-1,'0')<<endl;
      |                                 ^
Language: C++

#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
#ifdef LOCAL
#include"rprint.hpp"
#else
template <ostream& out = cout, class... T> void prints(T&&...){ }
template <ostream& out = cout, class... T> void printd(T&&...){ }
template <ostream& out = cout, class... T> void printb(T&&...){ }
template <ostream& out = cout, class... T> void printArr(T&&...){ }
#endif

int main(){
    // stringstream ans;
    ll num = 0;
    int ke = 0;
    for(int i = 0; i <= 9; i++){
        ke = i;
        ll a = pow(10ll, i);
        cout << "? " << a << endl;
        sleep(0);
        char ret; cin >> ret;
        if(ret == 'Y'){
        }else{
            break;
        }
        if(i == 9){
            for(int i = 0; i <= 11; i++){
                ke = i;
                ll a = pow(10ll, i + 1) - 1;
                cout << "? " << a << endl;
                char ret; cin >> ret;
                if(ret == 'Y'){
                    ke++;
                    break;
                }else{
                }
            }
        }
    }
    ke--;
    for(int i = ke; i >= 0; i--){
        ll l = 0, r = 9;
        while(l < r){
            // ll cand = (l + r + 1) / 2;
            ll cand = (l + r) / 2;
            // ll a = (cand + 1) * 10000000000 - 1;//, b = cand * 10000000000 - 1;
            ll a = num * pow(10ll, i + 2) + (cand + 1) * pow(10ll, i + 1) - 1;//, b = cand * 10000000000 - 1;
            // ll a = num * pow(10ll, i + 1) + (cand + 1) * pow(10ll, i + 0) - 1;//, b = cand * 10000000000 - 1;
            if(cand == 0){
                // a++;
                a /= 10;
            }
            // ll a = num * pow(10ll, i + 2) + cand * pow(10ll, i + 1);//, b = cand * 10000000000 - 1;
            // ll a = cand;//, b = cand * 10000000000 - 1;
            if(a == 0){
                cout << "! " << 1 << endl;
                return 0;
            }
            cout << "? " << a << endl;
            printd(l, r, num);
            char ret; cin >> ret;
            if(ret == 'Y'){
                // r = cand - 1;
                // if(cand == 0){
                //     a--;
                //     a /= 10;
                //     cout << "? " << a << endl;
                //     cin >> ret;
                //     if(ret == 'N'){
                //         l = cand + 1;
                //         goto hoge;
                //     }
                // }
                r = cand;
            }else{
                // l = cand;
                l = cand + 1;
            }
// hoge: ;
        }
        // ans << l;
        num = num * 10 + l;
    }
    // cout << "! " << stoi(ans.str()) << '\n';
    // cout << "! " << num + 1 << endl;
    cout << "! " << num << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'sleep' was not declared in this scope
   37 |         sleep(0);
      |         ^~~~~