# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
331976 | a_player | Password (RMI18_password) | C++14 | 172 ms | 516 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.
#include <bits/stdc++.h>
#ifdef ALE
#include "grader.cpp"
#endif
using namespace std;
int query(string str);
int v[50];
string solve(string ss,int n, int s){
int q=ss.size();
for(int k=0;k<s;k++)v[k]=0;
char possibile='a';
v[0]=1;
while(true){
string t=ss;
for(int i=0;i<n-q;i++)t+=possibile;
int l=query(t);
bool prec=false;
for(int i=0;i<s;i++){
if(v[i])continue;
v[i]=1;
assert(t.size()==n);
t[q]='a'+i;
if(query(t)>l){
possibile='a'+i;
prec=true;
i=s;
}
}
if(!prec){
return ss+possibile;
}
}
}
string guess(int n, int s){
string sol="";
for(int q=0;q<n;q++){
sol=solve(sol,n,s);
}
return sol;
}
Compilation message (stderr)
# | 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... |