Language: C++

#include <bits/stdc++.h>
using namespace std;
inline void read (int &x) {
	char ch = getchar(); x = 0;
	while (!isdigit(ch)) ch = getchar();
	while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
} 
char ch[100]; int n, len = 1e9, c[100]; string s[100];
inline int ask (string str){
	if (str.size() > 128) return 1e9;
	cout << '?' << ' ' << str << endl;
	fflush(stdout); int ans = 0; cin >> ans; return ans;
}
int ttm=0;
int query(string s){
	if(s.length()>128)return 0x3f3f3f3f;
	++ttm;
	if(ttm>=850)while(1);
	cout << "?" << " " << s << endl;
	fflush(stdout);
	int ans=0;
	// int t=0;
	// for(size_t q=0;q<Ans.length();q++){
	// 	if(t<s.length()&&s[t]==Ans[q]){
	// 		++t;
	// 	}
	// }
	// return t==s.size()?Ans.length()-t:Ans.length()-t+1;
	cin >> ans;
	return ans;
}
signed main() {
//	for (int i = 0; i < 10; ++i) ch[++n] = '0' + i;
//	for (int i = 0; i < 26; ++i) ch[++n] = 'a' + i;
//	for (int i = 0; i < 26; ++i) ch[++n] = 'A' + i;
	for (int i = 0; i < 26; ++i) 
		ch[++n] = 'A' + i, ch[++n] = 'a' + i;
	for (int i = 0; i < 10; ++i) ch[++n] = '0' + i;
	//查询单个字符，得出串的长度 
	for (int i = 1; i <= n; ++i) {
		s[i] += ch[i]; len = min (len, (c[i] = ask (s[i]) + 1));
	}
	//找出每个字符出现次数
	for (int i = 1; i <= n; ++i)
		if (c[i] != len) s[i] = string ();
		else while (ask (s[i] + ch[i]) + s[i].size() + 1 == len) s[i] += ch[i];
	//合并得出答案 
	while (1) {
		for (int i = 1; i <= n; ++i)
			for (int j = i + 1; j <= n; ++j)
				if (s[i].size() > s[j].size()) swap (s[i], s[j]);
		int l = 1; while (!s[l].size()) ++l;
		if (l == n) break;
		s[l + 1] = merge (s[l], s[l + 1]); s[l] = string ();
	} cout << '!' << ' ' << s[n] << endl; fflush (stdout);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:34: error: no matching function for call to 'merge(std::string&, std::string&)'
   54 |                 s[l + 1] = merge (s[l], s[l + 1]); s[l] = string ();
      |                            ~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4857:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter> _OIter std::merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter)'
 4857 |     merge(_InputIterator1 __first1, _InputIterator1 __last1,
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4857:5: note:   candidate expects 5 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:4908:5: note: candidate: 'template<class _IIter1, class _IIter2, class _OIter, class _Compare> _OIter std::merge(_IIter1, _IIter1, _IIter2, _IIter2, _OIter, _Compare)'
 4908 |     merge(_InputIterator1 __first1, _InputIterator1 __last1,
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4908:5: note:   candidate expects 6 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:412:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::merge(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _ForwardIterator, _Compare)'
  412 | merge(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:412:1: note:   candidate expects 7 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:417:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _ForwardIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator2> std::merge(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _ForwardIterator)'
  417 | merge(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2,
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:417:1: note:   candidate expects 6 arguments, 2 provided