Language: C++

#include<vector>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<algorithm>
#include<iostream>
#include<bitset>
#include<functional>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cassert>
#include<cmath>
#include<random>
#include<ctime>
#include<complex>
using namespace std;
typedef long long LL;
mt19937 gene(233);
typedef complex<double> Complex;
#define fi first
#define se second
#define ins insert
#define pb push_back
inline char GET_CHAR(){
	const int maxn = 131072;
	static char buf[maxn],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,maxn,stdin),p1==p2)?EOF:*p1++;
}
inline int getInt() {
	int res(0);
	char c = getchar();
	while(c < '0') c = getchar();
	while(c >= '0') {
		res = res * 10 + (c - '0');
		c = getchar();
	}
	return res;
}

inline int fastpo(int x, int n, int mod) {
	int res(1);
	while(n) {
		if(n & 1) {
			res = res * (LL)x % mod;
		}
		x = x * (LL) x % mod;
		n /= 2;
	}
	return res;
}

inline string itoa(int x, int width = 0) {
  string res;
  if(x == 0) res.push_back('0');
  while(x) {
    res.push_back('0' + x % 10);
    x /= 10;
  }
  while((int)res.size() < width) res.push_back('0');
  reverse(res.begin(), res.end());
  return res;
}

const int N = 133;
const int LOG = 20;
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
int n = 128, m;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
string s(128, 'A');
int dp[N][N];
int calc(string s, string t) {
	for(int i = 0; i <= (int)s.size(); i++) {
		for(int j = 0; j <= (int)t.size(); j++) {
			if(i == 0 || j == 0) dp[i][j] = max(i, j);
			else {
				dp[i][j] = min(dp[i - 1][j] + 1, dp[i][j - 1] + 1);
				dp[i][j] = min(dp[i][j], dp[i - 1][j - 1] + (s[i - 1] != t[i - 1]));
			}
		}
	}
	return dp[s.size()][t.size()];
}

void Assert(bool flag) {
	if(!flag) for(;;);
}
int debug = 0;
int _ = 0;
int tab[1111] = {127,128,127,128,128,128,128,128,127,128,127,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,127,128,127,127,127,128,128,128,128,128,128,128,128,128,127,128,128,126,127,126,128,128,128,128,128,128,128,128,128,127,128,128,128,128,128,128,14,14,14,14,14,14,14,14,14,14,14,14,13,14,13,13,13,14,13,14,14,14,13,13,14,14,14,13,13,13,14,13,14,13,14,14,13,13,14,13,13,14,14,13,12,14,13,13,13,};
vector<int> vec;
int ask(string t) {
_++;
cout << "? " << t << endl;
		
	Assert(1 <= t.size() && t.size() <= 128);
	for(char c : t) {
		Assert(('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') || ('0' <= c && c <= '9'));
	}
	if(debug) {
		vec.push_back(calc(s, t));
		cout << calc(s, t) << endl;
		return calc(s, t);
	}else {
		int x;
		cin >> x;
		/*if(x != tab[_ - 1]) {
			printf("! Atccod3rIsGreat");
			cout << endl;
			exit(0);
		}*/
		return x;
	}
}
string tmp(n, 'b'), wr(n, '!'), ans(n, '!');
void calc(char c, int le, int ri, int pre, int tot) {
	//cout << c << ' ' << le << ' ' << ri << ' ' << tot << endl;
	Assert(tot >= 0);
	if(tot == 0) return;
	if(le == ri) {
		if(tot == 1) ans[le] = c;
		return;
	}
	//cout << "pre" << pre << endl;
	int cnt = 0;
	for(int i = le; i <= ri; i++) {
		cnt += ans[i] == '!';
	}
	if(cnt == 1) {
		for(int i = le; i <= ri; i++) {
			if(ans[i] == '!') { ans[i] = c;  return;}
		}
	}
	int mid = -1;
	int bak = cnt;
	cnt = 0;
	for(int i = le; i <= ri; i++) {
		cnt += ans[i] == '!';
		if(cnt == bak / 2) {
			mid = i;
			break;
		}
	}
	Assert(mid != -1);
	//cout << cnt << ' ' << bak << ' ' << mid << endl;
	string t = wr;
	for(int i = 0; i <= mid; i++) t[i] = c;
	int x = n - ask(t);
	calc(c, le, mid, pre, x - pre);
	calc(c, mid + 1, ri, x, tot - (x - pre));
}
int getnum(char c) {
	string t = wr;
	for(int i = 0; i < n; i++) t[i] = c;
	int x = ask(t);
	return n - x;
}
int num[N];
int main() {
	s = "Atcod3rIsGreat";
	///cout << s.substr(7, 7) << endl;
	string cc;
	for(char c = 'A'; c <= 'Z'; c++) {
		cc.pb(c);
	}
	for(char c = 'a'; c <= 'z'; c++) {
		cc.pb(c);
	}
	for(char c = '0'; c <= '9'; c++) {
		cc.pb(c);
	}
	if(ask(s) == 0) {
		//cout << "! " << s << endl;
		//exit(0);
	}else {
		printf("! a\n");
		exit(0);
	}
	//for(int i = 0; i < 128; i++) s[i] = cc[i % 62];
	int na = getnum('a');
	int nb = getnum('b');
	int n1 = 0;
	Assert(na == 1 && nb == 0);
	for(int i = 0; i < cc.size(); i++) {
		char c = cc[i];
		int nc = getnum(c);
		num[i] = nc;
		n1 += nc;
	}
	n = n1;
	Assert(n == 14);
	tmp.resize(n);
	for(int i = 0; i < n; i++) {
		tmp[i] = 'a';
		if(ask(tmp) == n - 1 - nb) {
			wr[i] = 'b';
		}else wr[i] = 'a';
		tmp[i] = 'b';
	}
	wr.resize(n);
	//cout << wr << endl;
	for(int i = 0; i < cc.size(); i++) {
		calc(cc[i], 0, n - 1, 0, num[i]);
	}
	while(ans.back() == '!') ans.pop_back();
	//printf("{");
	//for(int i = 0; i < (int)vec.size(); i++) printf("%d,", vec[i]);
//	printf("}\n");
	Assert(ans[0] == "A");
	cout << "! " << ans << endl;
	//cout << _ << endl;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:213:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  213 |         Assert(ans[0] == "A");