# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1117356 | Ciprian | Password (RMI18_password) | C++14 | 1 ms | 336 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 query(string s);
string guess(int n, int s){
char a='a';
vector<char>c;
map<char, int>cnt;
for(int j=1; j<=s; j++){
cnt[a]=query(string(n, a));
if (cnt[s]) c.push_back(a);
a++;
}
string w="";
for(int i=1; i<=n; i++){
int r=0;
while(!cnt[c[r]] ){
r++;
}char x=c[r];
for(int j=r+1; j<c.size(); j++){
if (!cnt[c[j]]) continue;
if(query(w+c[j]+string(cnt[x], x))==w.size()+cnt[x]+1){
x=c[j];
}
}w+=x;
cnt[x]--;
}
return w;
}
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... |