# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
773332 | Khizri | Password (RMI18_password) | C++17 | 375 ms | 556 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>
#define ll long long
#define pb push_back
#define F first
#define S second
#define INF 1e18
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define OK cout<<"Ok"<<endl;
#define MOD (ll)(1e9+7)
using namespace std;
int query(string q);
int mxn=2e5+5;
int k;
string mrg(string a,string b){
string x;
int idx=0;
for(int i=0;i<b.size();i++){
for(int j=idx;j<=a.size();j++){
x=a;
x.insert(x.begin()+j,b[i]);
if(query(x)==x.size()){
a=x;
idx=j;
break;
}
}
}
return a;
}
string guess(int n, int kx){
char cc='a';
int k=kx;
kx--;
while(kx--){
cc++;
}
priority_queue<string,vector<string>,greater<string>>q;
for(char c='a';c<=cc;c++){
string s="";
for(int j=1;j<=n;j++){
s+=c;
}
int x=query(s);
s="";
for(int i=1;i<=x;i++){
s+=c;
}
if(s.size()>0){
q.push(s);
}
}
while(q.size()>1){
string a=q.top();
q.pop();
string b=q.top();
q.pop();
string x=mrg(a,b);
q.push(x);
}
return q.top();
}
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... |