#include <bits/stdc++.h>
using namespace std;
int query(string s);
string guess(int n, int s){
vector<int> ans;
pair<int,int> num[s];
string tst;
for(int i=0; i<s; i++){
tst="";
for(int j=0; j<n; j++){
tst+=(char)('a'+i);
}
num[i]={query(tst),i};
}
sort(num,num+s,greater<pair<int,int> >());
return "a";
for(int i=0; i<s; i++){
int chr=num[i].second,nom=num[i].first;
for(int k=0; k<nom; k++){
int aft=0;
for(int j=0; j<i; j++){
tst="";
for(int a=0; a<=k; a++) tst+=(char)('a'+chr);
for(int a=k+1; a<n; a++) tst+=(char)('a'+num[j].second);
int yey=query(tst)-k-1;
if(yey<0) return "a";
aft+=yey;
}
ans.insert(ans.end()-aft,chr);
}
}
tst="";
for(int i=0; i<n; i++) tst+=(char)('a'+ans[i]);
return tst;
}
# | 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... |