Submission #709074

# Submission time Handle Problem Language Result Execution time Memory
709074 2023-03-13T05:56:40 Z kxd Password (RMI18_password) C++17
Compilation error
0 ms 0 KB
int tot[26];
int ans[5000];

string guess(int n, int m) {
	forn(i,m) {
		string s (n,char('a'+i));
		tot[i] = query(s);
	}
	forn(i,m) {
		forn(j,tot[i]) {
			int ret = 0;
			forn(k,m) {
				if(k==i) continue;
				string s (j,'a'+i);
				string s2 (n-j,'a'+k);
				int t = query(s+s2);
				if(!t) break;
				ret += t;
			}
			ans[ret] = i;
		}
	}
	string s;
	forn(i,n) {
		s = s + (char)(ans[i]+'a');
	}
	return s;
}

Compilation message

password.cpp:4:1: error: 'string' does not name a type
    4 | string guess(int n, int m) {
      | ^~~~~~