| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1338526 | aaaaaaaa | Password (RMI18_password) | C++20 | 76 ms | 352 KiB |
#include <bits/stdc++.h>
using namespace std;
int query(string str);
string guess(int n, int s){
set<char> valid;
for(char ch = 'a'; ch <= 'z'; ++ch){
if((ch - 'a') >= s) break;
string str(1, ch);
if(query(str)) valid.insert(ch);
}
string answer = "";
int N = n;
--n;
while(n--){
for(char a : valid){
string validate = a + answer;
int ask = query(validate);
if(ask != (int) answer.size() + 1) continue;
bool ok = 1;
if(ask == N) return validate;
for(char b : valid){
string is_bad = "";
is_bad += a;
is_bad += b;
is_bad += answer;
int ask = query(is_bad);
if(ask == N) return is_bad;
if(ask == (int) answer.size() + 2){
ok = 0;
break;
}
}
if(ok) answer = a + answer;
}
}
if((int) answer.size() == N) return answer;
for(auto a : valid){
string is_ok = a + answer;
if(query(is_ok) == (int) answer.size() + 1) {
answer = is_ok;
break;
}
}
return answer;
}
| # | 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... | ||||
