# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
709207 | beepbeepsheep | Password (RMI18_password) | C++17 | 88 ms | 2492 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>
using namespace std;
int arr[26];
int query(string s);
string build(string s, char c, int pos){
string ret="";
for (int i=0;i<pos;i++){
ret+=s[i];
}
ret+=c;
for (int i=pos;i<s.size();i++){
ret+=s[i];
}
return ret;
}
string mrg(string a, string b){
if (a.size()>b.size()) swap(a,b);
if (a=="") return b;
string ans=b;
int l=0,r=ans.size()+1,m;
for (int i=0;i<a.size();i++){
for (int m=l;m<=r;m++){
string test=build(ans,a[i],m);
int res=query(test);
if (res==test.length()){
l=m;
ans=build(ans,a[i],m);
break;
}
cerr<<ans<<endl;
}
}
return ans;
}
string dup(char c, int n){
string ret="";
for (int i=0;i<n;i++) ret+=c;
return ret;
}
string guess(int n, int s){
for (int i=0;i<s;i++){
arr[i]=query(dup(i+'a',n));
}
string ans="";
for (int i=0;i<s;i++){
ans=mrg(ans,dup(i+'a',arr[i]));
}
return ans;
}
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... |