#include <bits/stdc++.h>
using namespace std;
int query(string str);
string guess(int n, int sz1){
vector<char> ans;
int current = 0;
for(int i = 0; i < sz1; i++) {
char x = (char)((int)'a' + i);
int ok = 0;
for(int j = 0; j <= ans.size(); j++) {
vector<char> v = ans;
v.insert(v.begin() + j, x);
string s = "";
for(auto it : v) {
s += it;
}
if(query(s) == current + 1) {
ans = v;
current += 1;
if(current == n) {
ok = 1;
break;
}
}
}
if(ok) {
break;
}
}
string e = "";
for(auto it : ans) {
e += it;
}
return e;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |