# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1116314 | Bula | Password (RMI18_password) | C++17 | 157 ms | 700 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 p);
string guess(int n, int s){
string t;
for(char c = 'a'; c <= 'z'; c++){
string p;
for(int i = 0; i < n; i++) p += c;
int x = query(p);
for(int i = 0; i < x; i++){
int l = 0, r = t.size();
while(l < r){
int m = (l + r) / 2;
p.clear();
for(int j = 0; j < m; j++) p += t[j];
p += c;
if(query(p) == m + 1) r = m;
else l = m + 1;
}
p.clear();
for(int j = 0; j < l; j++) p += t[j];
p += c;
for(int j = l; j < t.size(); j++) p += t[j];
t = p;
}
}
return t;
}
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... |