#include "bits/stdc++.h"
using namespace std;
// Hi
int query(string s);
string guess(int n,int s){
string res = "";
for(int i=0;i<n;i++){
bool found = 0;
for(int c=0;c<s;c++){
char ch = 'a'+c;
//cout << "first "<<ch+res<<'\n';
int pref = query((ch+res));
if(pref == i+1){
res += ch;
found = 1;
break;
}
}
if(found)continue;
for(int ind=0;ind<i;ind++){
for(int c=0;c<s;c++){
char ch = 'a'+c;
string temp = res.substr(0,ind+1)+ch+res.substr(ind+1,n-ind-1);
//cout << ind<<" "<<temp <<'\n';
int pref = query((temp));
if(pref == i+1){
res = temp;
found = 1;
break;
}
}
if(found)break;
}
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
548 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
456 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
456 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
548 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
548 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |