# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
755940 | vjudge1 | Password (RMI18_password) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
///YOU WILL MAKE IT
#include<bits/stdc++.h>
using namespace std;
int query(string s){
int p1=0;
string pass="abab";
cout<<s<<endl;
for(int i=0;i<pass.size();i++){
if(p1<s.size()&&s[p1]==pass[i]){
p1++;
}
}
return p1;
}
string guess(int n,int s){
string ans="";
for(int i=0;i<s;i++){
for(int j=0;j<n;j++){
bool f=0;
for(int k=0;k<ans.size();k++){
string temp=ans;
temp.insert(temp.begin()+k,i+'a');
if(query(temp)==temp.size()){
ans=temp;
f=1;
break;
}
}
if(!f){
string temp=ans;
temp.push_back(i+'a');
if(query(temp)==temp.size()){
ans=temp;
f=1;
// break;
}
}
}
}
return ans;
}