#include <bits/stdc++.h>
#include "combo.h"
// #define int long long
using namespace std;
std::string guess_sequence(int N) {
std::string p = "";
while(true) {
std::string q;
q = p;
p += "A";
if(press(p) == p.length() && p.length() == N)
break;
else if(press(p) == p.length())
continue;
p = q;
p += "B";
if(press(p) == p.length() && p.length() == N)
break;
else if(press(p) == p.length())
continue;
p = q;
p += "X";
if(press(p) == p.length() && p.length() == N)
break;
else if(press(p) == p.length())
continue;
p = q;
p += "Y";
if(p.length() == N)
break;
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |