# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
709079 |
2023-03-13T05:59:58 Z |
kxd |
Password (RMI18_password) |
C++17 |
|
0 ms |
0 KB |
int tot[26];
int ans[5000];
string guess(int n, int s) {
forn(i,s) {
string S (n,char('a'+i));
tot[i] = query(S);
}
forn(i,s) {
forn(j,tot[i]) {
int ret = 0;
forn(k,s) {
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 s) {
| ^~~~~~