# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
261070 | handlename | Password (RMI18_password) | C++17 | 533 ms | 768 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;
#define pb push_back
#define mp make_pair
int query(string str);
int num[26];
string guess(int n,int s){
set<pair<int,string> > process;
for (int i=0;i<s;i++){
string cur;
for (int j=0;j<n;j++) cur.pb('a'+i);
num[i]=query(cur);
cur.clear();
for (int j=0;j<num[i];j++){
cur.pb('a'+i);
}
process.insert(mp(num[i],cur));
}
while (process.size()>1){
string one=(*(process.begin())).second;
process.erase(process.begin());
string two=(*(process.begin())).second;
process.erase(process.begin());
string res=two;
int id=0; //idth guy not fixed
for (int i=0;i<one.size();i++){
string cur=res;
while (true){
string lol;
for (int j=0;j<id;j++){
lol.pb(cur[j]);
}
lol.pb(one[i]);
for (int j=id;j<cur.size();j++){
lol.pb(cur[j]);
}
if (query(lol)==lol.size()){
cur=lol;
break;
}
id++;
}
id++;
res=cur;
}
process.insert(mp(res.size(),res));
}
return (*(process.begin())).second;
}
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... |