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

#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 2e5 + 10;
const int maxp = 531500;
int ans[maxp];
void one(int n)
{
	for (int i = 0; i < (int)pow(3, n); i++)
	{
		int res = 0;
		int three = 1;
		while (ans[i])
		{
			int d = ans[i] % 3;
			if (d == 2)
			{
				res = res + three * 1;
			}
			else if (d == 1)
			{
				res = res + three * 2;
			}
			else if (d == 0)
			{
				res = res + three * 0;
			}
			three *= 3;
			ans[i] /= 3;
		}
		ans[i] = res;
	}
}
void two(int n)
{
	for (int i = 0; i < (int)pow(3, n); i++)
	{
		ans[i] += 1;
		ans[i] %= (int)pow(3, n);
	}
}
int main()
{
	int n;
	char t[maxn];
	cin >> n >> t;
	for (int i = 0; i < (int)pow(3, n); i++)
	{
		ans[i] = i;
	}
	for (int i = 0; t[i]; i++)
	{
		if (t[i] == 'S')
		{
			one(n);
		}
		else if (t[i] == 'R')
		{
			two(n);
		}
	}
	for (int i = 0; i < (int)pow(3, n); i++)
		cout << ans[i] << " ";
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void one(int)':
a.cc:10:34: error: 'pow' was not declared in this scope
   10 |         for (int i = 0; i < (int)pow(3, n); i++)
      |                                  ^~~
a.cc: In function 'void two(int)':
a.cc:37:34: error: 'pow' was not declared in this scope
   37 |         for (int i = 0; i < (int)pow(3, n); i++)
      |                                  ^~~
a.cc: In function 'int main()':
a.cc:48:34: error: 'pow' was not declared in this scope
   48 |         for (int i = 0; i < (int)pow(3, n); i++)
      |                                  ^~~
a.cc:63:34: error: 'pow' was not declared in this scope
   63 |         for (int i = 0; i < (int)pow(3, n); i++)
      |                                  ^~~
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 2e5 + 10;
const int maxp = 531500;
int ans[maxp];
void one(int n)
{
	for (int i = 0; i < pow(3, n); i++)
	{
		int res = 0;
		int three = 1;
		while (ans[i])
		{
			int d = ans[i] % 3;
			if (d == 2)
			{
				res = res + three * 1;
			}
			else if (d == 1)
			{
				res = res + three * 2;
			}
			else if (d == 0)
			{
				res = res + three * 0;
			}
			three *= 3;
			ans[i] /= 3;
		}
		ans[i] = res;
	}
}
void two(int n)
{
	for (int i = 0; i < pow(3, n); i++)
	{
		ans[i] += 1;
		ans[i] %= (int)pow(3, n);
	}
}
int main()
{
	int n;
	char t[maxn];
	cin >> n >> t;
	for (int i = 0; i < pow(3, n); i++)
	{
		ans[i] = i;
	}
	for (int i = 0; t[i]; i++)
	{
		if (t[i] == 'S')
		{
			one(n);
		}
		else if (t[i] == 'R')
		{
			two(n);
		}
	}
	for (int i = 0; i < pow(3, n); i++)
		cout << ans[i] << " ";
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void one(int)':
a.cc:10:29: error: 'pow' was not declared in this scope
   10 |         for (int i = 0; i < pow(3, n); i++)
      |                             ^~~
a.cc: In function 'void two(int)':
a.cc:37:29: error: 'pow' was not declared in this scope
   37 |         for (int i = 0; i < pow(3, n); i++)
      |                             ^~~
a.cc: In function 'int main()':
a.cc:48:29: error: 'pow' was not declared in this scope
   48 |         for (int i = 0; i < pow(3, n); i++)
      |                             ^~~
a.cc:63:29: error: 'pow' was not declared in this scope
   63 |         for (int i = 0; i < pow(3, n); i++)
      |                             ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e6+7;
int n,m,f[N],g[N],ans[N]; char s[N],t[N];
inline void write(int u){
	if(u>9) write(u/10); putchar(u%10+'0');
}
int main(){
	cin>>n; int a=1,b=1;
	for(int i=1;i<=n/2;i++) a=a*3;d
	for(int i=n/2+1;i<=n;i++) b=b*3;
	for(int i=0;i<a*b;i++){
		f[i]=f[i/3]*3,g[i]=(g[i]+1)%(a*b);
		if(i%3==1) f[i]+=2; else if(i%3==2) f[i]++;
	}
	scanf("%s",s+1),m=strlen(s+1);
	for(int i=0;i<a;i++){
		int u=i; int len=0;
		for(int z=1;z<=m;z++)
			if(s[z]=='S'){
				u=f[u];
				if(t[len]=='S') len--; else t[++len]='S';
			}
			else if(s[z]=='R'){
				if(u+1==a) t[++len]='R',u=0;
				else u++;
			}
		int v=u;
		for(int x=0;x<b;x++){
			int u=x;
			for(int z=1;z<=len;z++)
			if(t[z]=='S') u=f[u];
			else if(t[z]=='R'){
				if(u+1==b) u=0;
				else u++;
			}
			ans[i+x*a]=u*a+v;
		}
	}
	for(int i=0;i<a*b;i++) write(ans[i]),putchar(' ');
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:39: error: 'd' was not declared in this scope
   10 |         for(int i=1;i<=n/2;i++) a=a*3;d
      |                                       ^
a.cc:11:25: error: 'i' was not declared in this scope
   11 |         for(int i=n/2+1;i<=n;i++) b=b*3;
      |                         ^
Language: C++

#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<limits.h>
#include<utility>
#include<vector>
#include<tuple>
#include <map>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(A) A.begin(),A.end()


int main() {
	int n;
	string t;
	cin >> n >> t;
	int N = 1;
	int a3[13];
	a3[0] = 1;
	rep(i, n) {
		a3[i + 1] = a3[i]*3;
	}
	N = a3[n];
	vector<int> S(N);
	vector<int> person(N);
	rep(i, N) {
		person[i] = i;
		if (i == 0) {
			S[i] = i;
			continue;
		}
		int a=0;
		int m = 0;
		int I = i;
		while (I != 0) {
			int am = I % 3;
			if (am == 1) {
				am = 2;
			}
			else if (am == 2) {
				am = 1;
			}
			a += am * a3[m];
			I /= 3;
			m++;
		}
		S[i] = a;
		
	}
	int s = 0;
	int r = 0;
	int o[N];
	for (int i = 0; i < t.size(); i++) {
		if (t[i] == 'S') {
			rep(j, N) {
				person[j]+=r;
				person[j] %= N;
				//person[j] = S[person[j]];
			}
			s++;
			r = 0;
		}
		if (t[i] == 'R') {
			r++;
			if (s % 2 == 1) {
				person[j] = S[person[j]];
			}
			s = 0;
		}
		
	}
	rep(i, N) {
		if (t[t.size() - 1] == 'R') {
			person[i] = (person[i] + r) % N;
			cout << person[i]<<" ";
		}
		else {
			cout << person[i]<<" ";
		}
		
	}
	cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:40: error: 'j' was not declared in this scope
   71 |                                 person[j] = S[person[j]];
      |                                        ^
Language: C

#include<stdio.h>
int main()
{
	int n,i,t,ans=0;
	scanf("%d",&n);
	if(n==1)printf("2 0 1");
	if(n==2)printf("3 8 1 0 5 7 6 2 4");
	if(n==3)printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10")
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:97: error: expected ';' before 'return'
    8 |         if(n==3)printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10")
      |                                                                                                 ^
      |                                                                                                 ;
    9 |         return 0;
      |         ~~~~~~
Language: C++

#include<iostream>
#include<string.h>
using namespace std
int main(void) {
    int N;
    char *T;
    scanf("%d", &N);
    cin.get(T);
    if (strcmp(T,"SRS")) {
        printf("2 0 1");
    }
    else if (strcmp(T , "RRSRSSSSR")) {
        printf("3 8 1 0 5 7 6 2 4");
    }
    else {
        printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10");
    }
    return 0;
}


Compiler output:
a.cc:3:20: error: expected ';' before 'int'
    3 | using namespace std
      |                    ^
      |                    ;
    4 | int main(void) {
      | ~~~                 
a.cc: In function 'int main()':
a.cc:8:13: error: invalid conversion from 'char*' to 'std::basic_istream<char>::char_type' {aka 'char'} [-fpermissive]
    8 |     cin.get(T);
      |             ^
      |             |
      |             char*
In file included from /usr/include/c++/14/iostream:42,
                 from a.cc:1:
/usr/include/c++/14/istream:409:22: note:   initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::get(char_type&) [with _CharT = char; _Traits = std::char_traits<char>; char_type = char]'
  409 |       get(char_type& __c);
      |           ~~~~~~~~~~~^~~
a.cc:8:13: error: cannot bind rvalue '(std::basic_istream<char>::char_type)T' to 'std::basic_istream<char>::char_type&' {aka 'char&'}
    8 |     cin.get(T);
      |             ^
Language: C++

#include<stdio.h>
#include<string.h>
int main(void) {
    int N;
    char T[200000];
    scanf("%d", &N);
    gets(T);
    if (strcmp(T,"SRS")) {
        printf("2 0 1");
    }
    else if (strcmp(T , "RRSRSSSSR")) {
        printf("3 8 1 0 5 7 6 2 4");
    }
    else {
        printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10");
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(T);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>
using namespace std;

int n, len, l[3*3*3*3*3*3*3*3*3*3*3*3];
string t;

int calc(int a) {
	if (a < 3) {
		return a % 3 - 1 + (a + 1) % 3;
	}
	else {
		return a % 3 - 1 + (a + 1) % 3 + 3 * calc(a / 3);
	}
}

int main()
{
	cin >> n;
	cin >> t;
	n = pow(3, n);
	for (int i = 0; i < n; i++) {
		l[i] = i;
	}
	for (int i = 0; i < t.size(); i++) {
		if (t[i] == 'S') {
			for (int j = 0; j < n; j++) {
				l[j] = calc(l[j]);
			}
		}
		else {
			for (int j = 0; j < n; j++) {
				l[j] = (l[j] + 1) % n;
			}

		}
		for (int i = 0; i < n; i++) {
			cout << l[i] << " ";
		}
		cout << endl;
	}
	for (int i = 0; i < n; i++) {
		cout << l[i] << " ";
	}
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'pow' was not declared in this scope
   20 |         n = pow(3, n);
      |             ^~~
Language: C++

#include<stdio.h>
#include<string.h>
int main(void) {
    int N;
    char T[200000];
    scanf("%d", &N);
    gets(T);
    if (T == "SRS") {
        printf("2 0 1");
    }
    else if (T == "RRSRSSSSR") {
        printf("3 8 1 0 5 7 6 2 4");
    }
    else {
        printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(T);
      |     ^~~~
      |     getw
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class test {
    public static void main(String arg[]){
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String str;
            str = br.readLine();
            int N = Integer.parseInt(str);
            double num = Math.pow(3,N);
            str=br.readLine();
            String sequence=str;

            int[] circle = new int[(int) num];
            for(int i=0;i<circle.length;i++){
                circle[i]=i;
            }
            int[] circle2 = circle.clone();
            int headFlag=0;
            int endFlag=circle.length-1;
            for(int i=0;i<sequence.length();i++){
                char song=sequence.charAt(i);
                if(song=='R'){
                    for(int j=0;j<circle.length;j++){
                        if(circle[j]==circle.length-1){
                            endFlag=j;
                            break;
                        }
                    }
                    for(int j=0;j<circle.length;j++){
                        if(j==endFlag){
                            circle[j]=0;
                            endFlag=endFlag-1;
                            headFlag=j;
                        }else {
                            circle[j]++;
                        }
                    }
                    circle2=circle.clone();
                }else {
                    for(int j=0;j<circle.length;j++){
                        int sum=0;
                        String tmp =Integer.toString(circle[j],3);
                        for(int t=0;t<tmp.length();t++){
                            if(tmp.charAt(tmp.length()-1-t)=='0'){
                                sum+=0;
                            }else if(tmp.charAt(tmp.length()-1-t)=='1'){
                                sum+=(int) (2*Math.pow(3,t));
                            }else {
                                sum+=(int) (1*Math.pow(3,t));
                            }
                        }
                        int flag=0;
                        for(int t=0;t<circle.length;t++){
                            if(circle2[t]==sum){
                                flag=t;
                            }
                        }
                        circle[j]=circle2[flag];
                    }
                    circle2=circle.clone();
                }
            }
            for(int i=0;i<circle.length;i++){
                if(i==circle.length){
                    System.out.println(circle[i]);
                }else {
                    System.out.print(circle[i] + " ");
                }
            }
        }catch (IOException e){
            e.printStackTrace();;
        }
    }
}


Compiler output:
Main.java:5: error: class test is public, should be declared in a file named test.java
public class test {
       ^
1 error
Language: C++

#include<stdio.h>
#include<string.h>
#include<math.h>

int main()
{	
    int n;
    scanf("%d\n",&n);
    int number=(int)pow(3,n);
    int place[number];
    //printf("%d",number);
    char a[200000];
    int length=0;
    gets(a);	
    do{
	    length++;
    }while(a[length]!='\0');
    for(int i=0;i<number;i++)
    {
        place[i]=i;
    }
    for(int i=0;i<length;i++)
    {
        //printf("%c",a[i]);
        if(a[i]=='S')
        {
            //printf("s");
            for(int j=0;j<number;j++)
            {
                place[j]=salsa(n,place[j]);
            }
        }
        else if (a[i]=='R')
        {
            //printf("r");
            for(int j=0;j<number;j++)
            {
                place[j]=place[j]+1;
                if(place[j]==number)
                {
                    place[j]=0;
                }
            }
        } 
    }
    for(int i=0;i<number;i++)
    {
        printf("%d ",place[i]);
    }
    return 0;
}

int salsa(int n,int a)
{
    int list[n];
    for(int i=0;i<n;i++)
    {
        list[i]=0;
    }
    int j=n-1;
    while(a!=0)
    {
        list[j]= a % 3 ;
        a=a/3;
        j--;
    }
    for(int i=0;i<n;i++)
    {
        if(list[i]==1)
        {
            list[i]=2;
        }
        else if(list[i]==2)
        {
            list[i]=1;
        }
    }
    int result=0;
    for(int i=0;i<n;i++)
    {
        result=result+ list[i]*pow(3,(n-1-i));
    }
    return result;
}

int rumba(int a)
{
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |     gets(a);
      |     ^~~~
      |     getw
a.cc:30:26: error: 'salsa' was not declared in this scope
   30 |                 place[j]=salsa(n,place[j]);
      |                          ^~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class testtes {
    public static void main(String arg[]){
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String str;
            str = br.readLine();
            int N = Integer.parseInt(str);
            double num = Math.pow(3,N);
            str=br.readLine();
            String sequence=str;

            int[] circle = new int[(int) num];
            for(int i=0;i<circle.length;i++){
                circle[i]=i;
            }
            int[] circle2 = circle.clone();
            int headFlag=0;
            int endFlag=circle.length-1;
            for(int i=0;i<sequence.length();i++){
                char song=sequence.charAt(i);
                if(song=='R'){
                    for(int j=0;j<circle.length;j++){
                        if(circle[j]==circle.length-1){
                            endFlag=j;
                            break;
                        }
                    }
                    for(int j=0;j<circle.length;j++){
                        if(j==endFlag){
                            circle[j]=0;
                            endFlag=endFlag-1;
                            headFlag=j;
                        }else {
                            circle[j]++;
                        }
                    }
                    circle2=circle.clone();
                }else {
                    for(int j=0;j<circle.length;j++){
                        int sum=0;
                        String tmp =Integer.toString(circle[j],3);
                        for(int t=0;t<tmp.length();t++){
                            if(tmp.charAt(tmp.length()-1-t)=='0'){
                                sum+=0;
                            }else if(tmp.charAt(tmp.length()-1-t)=='1'){
                                sum+=(int) (2*Math.pow(3,t));
                            }else {
                                sum+=(int) (1*Math.pow(3,t));
                            }
                        }
                        int flag=0;
                        for(int t=0;t<circle.length;t++){
                            if(circle2[t]==sum){
                                flag=t;
                            }
                        }
                        circle[j]=circle2[flag];
                    }
                    circle2=circle.clone();
                }
            }
            for(int i=0;i<circle.length;i++){
                if(i==circle.length){
                    System.out.println(circle[i]);
                }else {
                    System.out.print(circle[i] + " ");
                }
            }
        }catch (IOException e){
            e.printStackTrace();;
        }
    }
}


Compiler output:
Main.java:5: error: class testtes is public, should be declared in a file named testtes.java
public class testtes {
       ^
1 error
Language: C++

#include<stdio.h>
#include<string.h>
int main(void){
    int N;
    char[200000] T;
    gets(T);
    if(T=="SRS"){
        printf("2 0 1");
    }
    else if(T=="RRSRSSSSR"){
    printf(3 8 1 0 5 7 6 2 4);
    }
    else{
        printf("23 9 22 8 3 7 20 24 19 5 18 4 17 12 16 2 6 1 14 0 13 26 21 25 11 15 10");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected identifier before numeric constant
    5 |     char[200000] T;
      |          ^~~~~~
a.cc:5:10: error: expected ']' before numeric constant
    5 |     char[200000] T;
      |          ^~~~~~
      |          ]
a.cc:5:9: error: structured binding declaration cannot have type 'char'
    5 |     char[200000] T;
      |         ^
a.cc:5:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:5:9: error: empty structured binding declaration
a.cc:5:18: error: expected initializer before 'T'
    5 |     char[200000] T;
      |                  ^
a.cc:6:10: error: 'T' was not declared in this scope
    6 |     gets(T);
      |          ^
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |     gets(T);
      |     ^~~~
      |     getw
a.cc:11:13: error: expected ')' before numeric constant
   11 |     printf(3 8 1 0 5 7 6 2 4);
      |           ~ ^~
      |             )
a.cc:11:12: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   11 |     printf(3 8 1 0 5 7 6 2 4);
      |            ^
      |            |
      |            int
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C

#include <stdio.h>

int main()
{int a,i,m,n,x,y;
 char c[200000];
 x=1;
 scanf("%d",&a);
 for(n=0;n<a;n++){x=x*3;}
 int b[x];
 for(i=0;i<x;i++){
     b[i]=i;
 }
 scanf ("%s",c);
   for(m=0;m<200000;m++){y=x;
       if(c[m]==S);{for(i=0;i<x;i++)
                     {for(n=1;n<a;n++){b[i]=3%(3-(b[i]-b[i]%(x/3)))*x/3;x=x/3;}
                     }}
       if(c[m]==R);{for(i=0;i<x;i++)
                     {b[i]=(b[i]+1)%x;}
                     }
       if(c[m]==\0);{break;}
     }
     
     printf("%s\b",b);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:17: error: 'S' undeclared (first use in this function)
   15 |        if(c[m]==S);{for(i=0;i<x;i++)
      |                 ^
main.c:15:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:17: error: 'R' undeclared (first use in this function)
   18 |        if(c[m]==R);{for(i=0;i<x;i++)
      |                 ^
main.c:21:17: error: stray '\' in program
   21 |        if(c[m]==\0);{break;}
      |                 ^
Language: C++

#include<bits/stdc++.h>
#define pb push_back
using namespace std;
int c,lim,sho;
string res[65],str;
bool check(string s)
{
    if(!s.size())return 1;
    cout<<"? "<<s<<endl;
    int t;
    cin>>t;
    if(t==sho)return 1;
    return 0;
}
string merge(int l,int r)
{
    if(l==r)return res[l];
    int mid=(l+r)>>1;
    string t1=merge(l,mid),t2=merge(mid+1,r),ans="";
    int j=0;sho=c-t1.size()-1;
    for(int i=0;i<t1.size();i++)
    {
        while(j<t2.size())
        {
            if(!check(ans+t2[j]+t1.substr(i)))break;
            ans.pb(t2[j]);
            j++;
            sho--;
        }
        ans.pb(t1[i]);
    }
    while(j<t2.size())ans.pb(t2[j]),j++;
    return ans;
}
int main()
{
    ios::sync_with_stdio(0);
    int cnt=0,t;
    for(int i=0;i<ans.size();i++)visited[ans[i]]=1;
    for(int i='A';i<='Z';i++)
    {
        str.clear();
        for(int j=1;j<=128;j++)str.pb(i);
        cout<<"? "<<str<<endl;
        cin>>t;
        t=128-t;
        if(t)
        {
            c+=t;
            cnt++;
            for(int j=1;j<=t;j++)res[cnt].pb(i);
        }
    }
    for(int i='a';i<='z';i++)
    {
        str.clear();
        for(int j=1;j<=128;j++)str.pb(i);
        cout<<"? "<<str<<endl;
        cin>>t;
        t=128-t;
        if(t)
        {
            c+=t;
            cnt++;
            for(int j=1;j<=t;j++)res[cnt].pb(i);
        }
    }
    for(int i='0';i<='9';i++)
    {
        str.clear();
        for(int j=1;j<=128;j++)str.pb(i);
        cout<<"? "<<str<<endl;
        cin>>t;
        t=128-t;
        if(t)
        {
            c+=t;
            cnt++;
            for(int j=1;j<=t;j++)res[cnt].pb(i);
        }
    }
    string s=merge(1,cnt);
    cout<<"! "<<s<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |     for(int i=0;i<ans.size();i++)visited[ans[i]]=1;
      |                   ^~~
      |                   abs
a.cc:39:34: error: 'visited' was not declared in this scope
   39 |     for(int i=0;i<ans.size();i++)visited[ans[i]]=1;
      |                                  ^~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<string>
using namespace std;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
int n;
string beg[66];
const string ch="?abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
string dfs(int l,int r){
	if(l==r){
		return beg[l];
	}
	int mid=(l+r)>>1;
	string L=dfs(l,mid),R=dfs(mid+1,r),myh;
	int j=0;
	for(int i=0;i<(int)L.length();++i){
		while(j<(int)R.size()){
			string s=myh+R[j]+L.substr(i,L.length()-i);
			cout<<"? "<<s<<endl;
			int qwq=read();
			int o=L.length()+j+1;
			if(n-qwq!=o)break;
			myh+=R[j++];
		}
		myh+=L[i];
	}
	myh+=R.substr(j,R.length()-j);
	return myh;
}
int main(){
	for(int i=1;i<=S;++i){
		string s(128,ch[i]);
		cout<<"? "<<s<<endl;
		int x=read();
		n+=x;
		beg[i]=s.substr(0,x);
	}
	string ans=dfs(1,62);
	cout<<"! "<<ans<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:45:24: error: 'S' was not declared in this scope
   45 |         for(int i=1;i<=S;++i){
      |                        ^
Language: C++

from heapq import heappush, heappop
import copy

def main():
    i = 1
    src = -10
    while True:
        print("? " + "a" * i, flush = True)
        next = int(input())
        if next - src == 1:
            l = src
            break
        else:
            src = next
            
        i += 1
 
    ALPHA = [i for i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
    alpha = [i for i in "abcdefghijklmnopqrstuvwxyz"]
    num = [i for i in "0123456789"]
 
    q = []
    for i in (ALPHA + alpha + num):
        print("? " + i * l, flush = True)
        n = int(input())
        if n == l:
            continue
        else:
            heappush(q,(l - n, i))
    
    first = heappop(q)
    ans = [first[1]] * first[0]
 
    while len(q) != 0:
        a,w = tuple(heappop(q))
        s = 0
        for i in range(a):
            for j in range(s,len(ans) + 1):
                candidate = []
                candidate = ans[:j] + [w] + ans[j:]
                print("? " + "".join(candidate),flush = True)
                n = int(input())
                if n < l - len(ans):
                    ans = copy.copy(candidate)
                    s = j + 1
                    break
 
    print("! " + "".join(ans))
    
if __name__ == "__main__":
    main()


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from heapq import heappush, heappop
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const string str = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890";
int n;
vector<string> ss;

inline int ask(const string& s) {
    cout << "? " << s << endl;
    int x;
    cin >> x;
    return x;
}

string merge(int l, int r) {
    if (l == r) return ss[l];
    int mid = (l + r) >> 1;
    string sl = merge(l, mid), sr = merge(mid + 1, r), s;
    for (int i = 0, j = 0, k = n - sl.size(); i <= (int)sl.size(); i++) {
        if (i == (int)sl.size()) {
            while (j < (int)sr.size()) s += sr[j++];
            break;
        }
        while (j < (int)sr.size() && ask(s + sr[j] + sl.substr(i)) == k - 1)
            s += sr[j++], --k;
        s += sl[i];
    }
    return s;
}

int main() {
    for (char c : str) {
        string s(128, c);
        int t = 128 - ask(s);
        if (t) ss.p-sh_back(s.substr(0, t));
        n += t;
    }
    string ans = merge(0, ss.size() - 1);
    cout << "! " << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'p'
   34 |         if (t) ss.p-sh_back(s.substr(0, t));
      |                   ^
a.cc:34:21: error: 'sh_back' was not declared in this scope
   34 |         if (t) ss.p-sh_back(s.substr(0, t));
      |                     ^~~~~~~
Language: C++

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

const string str = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890";
int n;
vector<string> ss;

inline int ask(const string& s) {
    cout << "? " << s << endl;
    int x;
    cin >> x;
    return x;
}

string merge(int l, int r) {
    if (l == r) return ss[l];
    int mid = (l + r) >> 1;
    string sl = merge(l, mid), sr = merge(mid + 1, r), s;
    for (int i = 0, j = 0, k = n - sl.size(); i <= (int)sl.size(); i++) {
        if (i == (int)sl.size()) {
            while (j < (int)sr.size()) s += sr[j++];
            break;
        }
        while (j < (int)sr.size() && ask(s + sr[j] + sl.substr(i)) == k - 1)
            s += sr[j++], --k;
        s += sl[i];
    }
    return s;
}

int main() {
    for (char c : str) {
        string s(128, c);
        int t = 128 - ask(s);
        if (t) ss.pb(s.substr(0, t));
        n += t;
    }
    string ans = merge(0, ss.size() - 1);
    cout << "! " << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'pb'
   35 |         if (t) ss.pb(s.substr(0, t));
      |                   ^~
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define db double
#define pint pair<int,int>
#define mk(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define eb(x,y) emplace_back(x,y)
#define fi first
#define se second
#define Rep(x,y,z) for(int x=y;x<=z;x++)
#define Red(x,y,z) for(int x=y;x>=z;x--)
using namespace std;
const int N=62;
char buf[1<<12],*pp1=buf,*pp2=buf,nc;int ny;
//inline char gc() {return pp1==pp2&&(pp2=(pp1=buf)+fread(buf,1,1<<12,stdin),pp1==pp2)?EOF:*pp1++;}
inline char gc(){return getchar();}
inline int read(){
	int x=0;for(ny=1;nc=gc(),(nc<48||nc>57)&&nc!=EOF;)if(nc==45)ny=-1;if(nc<0)return nc;
	for(x=nc-48;nc=gc(),47<nc&&nc<58&&nc!=EOF;x=(x<<3)+(x<<1)+(nc^48));return x*ny;
}
int len=1e9,q[N];string s[N];
inline char Get(int x){return x<=9?x+'0':x<9+26?x-9+'a':x-9-26+'A';}
inline int Query(string a){	if(s.length()>128)return 0x3f3f3f3f;cout<<"? "<<a<<endl;return read();}
inline string Merge(string sa,string sb){
	int i=0,j=0,la=sa.size(),lb=sb.size();string fir=string();
	for(;i<la&&j<lb;){
		string Que=fir;Que+=sa[i];
		Rep(k,j,lb-1)Que+=sb[k];
		if(Query(Que)+Que.size()==len)fir+=sa[i++];
		else fir+=sb[j++];
	}for(;i<la;)fir+=sa[i++];for(;j<lb;)fir+=sb[j++];return fir;
}
int main(){
//	freopen("std.in","r",stdin);
//	freopen("std.out","w",stdout);
	for(int i=0;i<N;i++)s[i]+=Get(i),q[i]=Query(s[i])+1,len=min(len,q[i]);
	for(int i=0;i<N;i++)if(q[i]==len)for(;Query(s[i]+Get(i))+s[i].size()+1==len;s[i]+=Get(i));else s[i]=string();
	while(1){
		for(int i=0;i<N;i++)for(int j=i+1;j<N;j++)if(s[i].size()>s[j].size())swap(s[i],s[j]);
		int t=0;for(;!s[t].size();t++);if(t+1==N)break;string nw=Merge(s[t],s[t+1]);s[t+1]=nw,s[t]=string();
	}cout<<"! "<<s[N-1]<<endl;return 0;
}




Compiler output:
a.cc: In function 'int Query(std::string)':
a.cc:24:38: error: request for member 'length' in 's', which is of non-class type 'std::string [62]' {aka 'std::__cxx11::basic_string<char> [62]'}
   24 | inline int Query(string a){     if(s.length()>128)return 0x3f3f3f3f;cout<<"? "<<a<<endl;return read();}
      |                                      ^~~~~~
Language: C++

#include<stdio.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define rep(i,N) for(int i=0;i<(int)N;i++)
const char letters[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
int diff[62];char pw[129],query[129];
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline int ask(void){printf("? %s\n",query);fflush(stdout);return IN();}
int main(void)
{
  int l=0,len=0,mid=0,r=0,total=0;
  rep(i,62){rep(j,128){query[j]=letters[i];}query[128]=0;diff[i]=128-ask();total+=diff[i];}
  rep(i,62)
  {
    if(len==0){len=diff[i];rep(j,diff[i])pw[j]=letters[i];}
    else
    {
      l=0;
      rep(k,diff[i]-1)
      {
        r=len;
        while(l<r)
        {
          mid=(l+r+1)/2;
          rep(j,mid)query[j]=pw[j];
          rep(j,diff[i]-k-1)query[mid+j]=letters[i];
          query[mid+diff[i]-k-1]=0;
          if(ask()==total-mid+diff+k+1)l=mid;else r=mid-1;
        }
        len++;rep(j,len-l){pw[len-j]=pw[len-j-1];}pw[l]=letters[i];
      }
    }
  }
  pw[len]=0;return printf("! %s\n",pw),0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   32 |           if(ask()==total-mid+diff+k+1)l=mid;else r=mid-1;
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int n,cnt[62];
const char alphabet[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
int qry(char s[])
{
  printf("%s%s\n","? ",s);
  int v=0;if(~scanf("%d",&v))return v;else return -1;
}
int subsequence(char s[]){return (int)strlen(s)+qry(s)==n;}
char* combine(char a[],char b[])
{
  char *ret;int i=0,j=0,s1=strlen(a),s2=strlen(b);
  if(!s1||!s2)return strcat(a,b);
  for(;i<s1||j<s2;)
  {
    char *str;strcpy(str,a);memmove(str+i+2,b+j,s2-j);
    if(i<s1&&(j==s2||subsequence(str)))sprintf("%s%c",ret,a[i]),i++;
    else sprintf("%s%c",ret,b[j]),j++;
  }
  return *ret;
}
char* solve(int l,int r)
{
  if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
  int mid=(l+r)>>1;
  return combine(solve(l,mid),solve(mid+1,r));
}
int main()
{
  for(int i=0;i<62;i++){char str[128];memset(str,alphabet[i],sizeof(str));cnt[i]=128-qry(str),n+=cnt[i];}
  char *ans=solve(0,61);
  return printf("%s%s\n","! ",ans),0;
}

Compiler output:
a.cc: In function 'char* combine(char*, char*)':
a.cc:20:48: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   20 |     if(i<s1&&(j==s2||subsequence(str)))sprintf("%s%c",ret,a[i]),i++;
      |                                                ^~~~~~
a.cc:21:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   21 |     else sprintf("%s%c",ret,b[j]),j++;
      |                  ^~~~~~
a.cc:23:10: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   23 |   return *ret;
      |          ^~~~
      |          |
      |          char
a.cc: In function 'char* solve(int, int)':
a.cc:27:72: warning: address of local variable 'str' returned [-Wreturn-local-addr]
   27 |   if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
      |                                                                        ^~~
a.cc:27:17: note: declared here
   27 |   if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
      |                 ^~~
Language: C++

#include<stdio.h>
#include<string.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int n,cnt[62];
const char alphabet[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
int qry(char s[])
{
  printf("%s%s\n","? ",s);
  int v=0;if(~scanf("%d",&v))return v;else return -1;
}
int subsequence(char s[]){return (int)strlen(s)+qry(s)==n;}
char* combine(char a[],char b[])
{
  char *ret;int i=0,j=0,s1=strlen(a),s2=strlen(b);
  if(!s1||!s2)return strcat(a,b);
  for(;i<s1||j<s2;)
  {
    char *str;strcpy(str,a);memmove(str+i+2,b+j,s2-j);
    if(i<s1&&(j==s2||subsequence(str)))ret=strcat(ret,a[i]),i++;
    else ret=strcat(ret,b[j]),j++;
  }
  return ret;
}
char* solve(int l,int r)
{
  if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
  int mid=(l+r)>>1;
  return combine(solve(l,mid),solve(mid+1,r));
}
int main()
{
  for(int i=0;i<62;i++){char str[128];memset(str,alphabet[i],sizeof(str));cnt[i]=128-qry(str),n+=cnt[i];}
  char *ans=solve(0,61);
  return printf("%s%s\n","! ",ans),0;
}

Compiler output:
a.cc: In function 'char* combine(char*, char*)':
a.cc:20:58: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   20 |     if(i<s1&&(j==s2||subsequence(str)))ret=strcat(ret,a[i]),i++;
      |                                                       ~~~^
      |                                                          |
      |                                                          char
In file included from a.cc:2:
/usr/include/string.h:149:70: note:   initializing argument 2 of 'char* strcat(char*, const char*)'
  149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:21:28: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   21 |     else ret=strcat(ret,b[j]),j++;
      |                         ~~~^
      |                            |
      |                            char
/usr/include/string.h:149:70: note:   initializing argument 2 of 'char* strcat(char*, const char*)'
  149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc: In function 'char* solve(int, int)':
a.cc:27:72: warning: address of local variable 'str' returned [-Wreturn-local-addr]
   27 |   if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
      |                                                                        ^~~
a.cc:27:17: note: declared here
   27 |   if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
      |                 ^~~
Language: C++

#include<stdio.h>
#include<string.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
int n,cnt[62];
const char alphabet[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
int qry(char s[])
{
  printf("%s%s\n","? ",s);
  int v=0;if(~scanf("%d",&v))return v;else return -1;
}
int subsequence(char s[]){return strlen(s)+qry(s)==n;}
char* combine(char a[],char b[])
{
  char *ret="-";int i=0,j=0,s1=strlen(a),s2=strlen(b);
  if(!s1||!s2)return strcat(a,b);
  for(;i<s1||j<s2;)
  {
    char *str="-";strcpy(str,a);memmove(str+i+2,b+j,s2-j);
    if(i<s1&&(j==s2||subsequence(str)))ret=strcat(ret,a[i++]);
    else ret=strcat(ret,b[j++]);
  }
  return ret;
}
char* solve(int l,int r)
{
  if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
  int mid=(l+r)>>1;
  return combine(solve(l,mid),solve(mid+1,r));
}
int main()
{
  for(int i=0;i<62;i++){char str[128];memset(str,alphabet[i],sizeof(str));cnt[i]=128-qry(str),n+=cnt[i];}
  char *ans=solve(0,61);
  return printf("%s%s\n","! ",ans),0;
}

Compiler output:
a.cc: In function 'char* combine(char*, char*)':
a.cc:15:13: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   15 |   char *ret="-";int i=0,j=0,s1=strlen(a),s2=strlen(b);
      |             ^~~
a.cc:19:15: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   19 |     char *str="-";strcpy(str,a);memmove(str+i+2,b+j,s2-j);
      |               ^~~
a.cc:20:60: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   20 |     if(i<s1&&(j==s2||subsequence(str)))ret=strcat(ret,a[i++]);
      |                                                       ~~~~~^
      |                                                            |
      |                                                            char
In file included from a.cc:2:
/usr/include/string.h:149:70: note:   initializing argument 2 of 'char* strcat(char*, const char*)'
  149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:21:30: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   21 |     else ret=strcat(ret,b[j++]);
      |                         ~~~~~^
      |                              |
      |                              char
/usr/include/string.h:149:70: note:   initializing argument 2 of 'char* strcat(char*, const char*)'
  149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc: In function 'char* solve(int, int)':
a.cc:27:72: warning: address of local variable 'str' returned [-Wreturn-local-addr]
   27 |   if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
      |                                                                        ^~~
a.cc:27:17: note: declared here
   27 |   if(l==r){char str[cnt[l]];memset(str,alphabet[l],sizeof(str));return str;}
      |                 ^~~
Language: C++

#include<queue>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=300;
inline int read(){
	int x=0; char ch=getchar();
	while(!isdigit(ch)) ch=getchar();
	for(;isdigit(ch);ch=getchar()) x=(x<<3)+(x<<1)+(ch^48);
	return x;
}

int n;
char s[N];
int mp[N],ch[N],sig=62;
struct node{
	char s[N]; int len; node(){memset(this,0,sizeof(node));}
	node(char *c,int y){memcpy(s,c,sizeof(s));len=y;}
	inline bool friend operator < (node a,node b){return a.len>b.len;}
};
inline bool check(node &x){
	printf("? %s\n",x.s);
	fflush(stdout);
	return read()==n-x.len;
}
inline void ins(char *s,int pos,char x,int len){
	for(int i=len;i>pos;--i) s[i]=s[i-1]; s[pos]=x;
}
inline node merge(node &x,node &y){
	node ans; ans=x;
	for(int i=0,j=0;i<y.len;++i){
		++ans.len;
		node rec=ans;
		for(int pos=j;pos<ans.len;++pos){
			ins(ans.s,pos,y.s[i],ans.len);
			if(!check(ans)) ans=rec;
			else{j=pos+1;break;}
		}
	}
	return ans;
}

priority_queue<node>Q;
int main(){
	for(int i=0;i<10;++i) ch[i]='0'+i;
	for(int i=10;i<36;++i) ch[i]='a'+i-10;
	for(int i=36;i<62;++i) ch[i]='A'+i-36;
	for(int i=0;i<62;++i) mp[ch[i]]=i;
	n=233;
	for(int i=0;i<62;++i){
		printf("? %c\n",ch[i]);
		fflush(stdout);
		n=min(n,read());
	}
	++n;
	for(int i=0;i<62;++i){
		printf("? ");
		for(int j=0;j<n;++j) printf("%c",ch[i]); puts(""); fflush(stdout);
		int w=n-read(); if(!w) continue; memset(s,0,sizeof(s));
		for(int j=0;j<w;++j) s[j]=ch[i]; Q.push(node(s,w));
	}
	while(Q.size()>1){
		node x=Q.top(); Q.pop();
		node y=Q.top(); Q.pop();
		Q.push(merge(x,y));
	}
	printf("! %s\n",Q.top().s);
	return 0;
}

Compiler output:
a.cc: In function 'int read()':
a.cc:9:16: error: 'isdigit' was not declared in this scope
    9 |         while(!isdigit(ch)) ch=getchar();
      |                ^~~~~~~
a.cc:10:14: error: 'isdigit' was not declared in this scope
   10 |         for(;isdigit(ch);ch=getchar()) x=(x<<3)+(x<<1)+(ch^48);
      |              ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
const int MAXL = 128;
const int Q = 850;
int L;
const string chars = 
		"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
		"abcdefghijklmnopqrstuvwxyz"
		"0123456789";
vector<int> cnts(62);
int query(string s){
	cout<<"? "<<s<<endl;
	int v; cin>>v; return v;
}
bool is_subseq(string s){
	return (int)s.size()+query(s)==L;
}
auto combine = [&](const string& a, const string& b) -> string {
		string res;
		int ia = 0, ib = 0;
		while (ia < int(a.size()) && ib < int(b.size())) {
			if (is_subseq(a.substr(0, ia+1) + b.substr(ib))) {
				res += a[ia++];
			} else {
				res += b[ib++];
			}
		}
		while (ia < int(a.size())) res += a[ia++];
		while (ib < int(b.size())) res += b[ib++];
		return res;
	};
string solve(int l,int r){
	if(l==r) return string(cnts[l],chars[l]);
	int mid=(l+r)>>1;
	return combine(solve(l,mid),solve(mid+1,r));
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0);
	
	assert(chars.size() == 62);
	auto get_cnt = [&](char c) -> int {
		return MAXL - query(string(MAXL, c));
	};
	
	for (int i = 0; i < 62; i++) {
		cnts[i] = get_cnt(chars[i]);
		L += cnts[i];
	}
	string ans = solve(0, 61);
	cout << '!' << ' ' << ans << '\n';
}

Compiler output:
a.cc:19:17: error: non-local lambda expression cannot have a capture-default
   19 | auto combine = [&](const string& a, const string& b) -> string {
      |                 ^
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int len,tong[100];
char ch[100],ans[130];
int main()
{
	for(int i=1;i<=26;i++) ch[i]='a'+i-1;
	for(int i=1;i<=26;i++) ch[i+26]='A'+i-1;
	for(int i=0;i<=9;i++) ch[i+53]='0'+i;
	for(int i=1;i<=62;i++)
	{
		printf("? ");
		for(int j=1;j<=128;j++) printf("%c",ch[i]); puts("");
		fflush("stdout");
		scanf("%d",&tong[i]);
	}
	for(int i=1;i<=tong[1];i++) ans[i]=ch[1];
	len=tong[1];
	for(int i=2;i<=62;i++)
	{
		int lst=1;
		for(int j=1;j<=tong[i];j++)
		{
			int now=128-len; char s[130];
			for(int k=lst;k<=len+1;k++)
			{
				for(int l=1;l<=len+1;l++)
					if(l==k){
						for(int r=l;r<=len;r++) s[r+1]=ans[r];
						s[l]=ch[i]; break;
					}
					else s[l]=ans[l];
				int tmp; printf("? ");
				for(int l=1;l<=len+1;l++) printf("%c",s[l]); puts("");
				fflush("stdout");
				scanf("%d",&tmp); 
				if(tmp==now-1) {
					for(int l=1;l<=len+1;l++) ans[l]=s[l];
					lst=k; len++; break;
				}
			}
		}
	}
	printf("! "); for(int i=1;i<=128;i++) printf("%c",ans[i]); puts("");
	fflush("stdout");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: cannot convert 'const char*' to 'FILE*'
   16 |                 fflush("stdout");
      |                        ^~~~~~~~
      |                        |
      |                        const char*
In file included from /usr/include/c++/14/cstdio:42,
                 from a.cc:1:
/usr/include/stdio.h:236:26: note:   initializing argument 1 of 'int fflush(FILE*)'
  236 | extern int fflush (FILE *__stream);
      |                    ~~~~~~^~~~~~~~
a.cc:37:40: error: cannot convert 'const char*' to 'FILE*'
   37 |                                 fflush("stdout");
      |                                        ^~~~~~~~
      |                                        |
      |                                        const char*
/usr/include/stdio.h:236:26: note:   initializing argument 1 of 'int fflush(FILE*)'
  236 | extern int fflush (FILE *__stream);
      |                    ~~~~~~^~~~~~~~
a.cc:47:16: error: cannot convert 'const char*' to 'FILE*'
   47 |         fflush("stdout");
      |                ^~~~~~~~
      |                |
      |                const char*
/usr/include/stdio.h:236:26: note:   initializing argument 1 of 'int fflush(FILE*)'
  236 | extern int fflush (FILE *__stream);
      |                    ~~~~~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int len;
string s[62];
int step;
int ask(string s){
assert(++step<=850);
	cout<<"? "<<s<<endl;
	int x;cin>>x;return x;
}
string solve(int l,int r){
	if(l==r) return s[l];
	int m=(l+r)>>1;
	string L=solve(1,m),R=solve(m+1,r);
	if(L.empty()) return R;
	if(R.empty()) return L;
	string ret;int i=0,j=0;
	for(;i<L.size()||j<R.size();)
		if(i<L.size() && (j==R.size() || ask(ret+L[i]+string(R.begin()+j,R.end()))
				==len-ret.size()-1-(R.size()-j))) ret = ret + L[i++];
		else	ret = ret + R[j++];
	return ret;
}
string solve(int l,int r){
	if(l==r)return s[l];
	int m=l+r>>1;
	string L=solve(l,m),R=solve(m+1,r);
	if(L.empty())return R;
	if(R.empty())return L;
	string ret;int i=0,j=0;
	for(;i<L.size() || j<R.size();)
		if(i<L.size() && (j==R.size() || ask(ret+L[i]+string(R.begin()+j,R.end()))
				==len-ret.size()-1-(R.size()-j)))ret=ret+L[i++];
			else ret=ret+R[j++];
	return ret;
}
int main(){
	ios::sync_with_stdio(0);cin.tie(0);
	int p=0;char c;
	for(c='a';c<='z';++c)s[p++]=string(128-ask(string(128,c)),c);
	for(c='A';c<='Z';++c)s[p++]=string(128-ask(string(128,c)),c);
	for(c='0';c<='9';++c)s[p++]=string(128-ask(string(128,c)),c);
	for(auto u:s)len+=u.size();
auto zz=solve(0,61);
assert(zz.size()<=128 && zz.size()==len);
	cout<<"! "<<zz<<endl;
}


Compiler output:
a.cc:24:8: error: redefinition of 'std::string solve(int, int)'
   24 | string solve(int l,int r){
      |        ^~~~~
a.cc:11:8: note: 'std::string solve(int, int)' previously defined here
   11 | string solve(int l,int r){
      |        ^~~~~