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>
int press(std::string p);
std::string guess_sequence(int n) {
std::string ans="";
if (press("A")) ans="A";
else if (press("B")) ans="B";
else if (press("X")) ans="X";
else ans="Y";
std::string f=ans;
int l=1;
while (l<n) {
if (f!="A"&&press(ans+"A")>l) {
ans+="A";
} else if (f!="B"&&press(ans+"B")>l) {
ans+="B";
} else if (f!="X"&&press(ans+"X")>l) {
ans+="X";
} else {
ans+="Y";
}
l++;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |