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>
#include "combo.h"
using namespace std;
typedef long long ll;
std::string guess_sequence(int N) {
string s, t;
if(press(s+'A'+s+'B')>=1) {
if(press(s+'A')>=1){
s+='A';
t="BXY";
}
else{
s+='B';
t="AXY";
}
}
else{
if(press(s+'X')>=1){
s+='X';
t="ABY";
}
else{
s+='Y';
t="ABX";
}
}
for(ll i=1; i<N-1; i++){
ll ans=press(s+t[0]+s+t[1]+t[0]+s+t[1]+t[1]+s+t[1]+t[2]);
if(ans==i) s+=t[2];
else if(ans==i+1) s+=t[0];
else s+=t[1];
}
if(press(s+'A'+s+'B')>=N) {
if(press(s+'A')>=N){
s+='A';
}
else{
s+='B';
}
}
else{
if(press(s+'X')>=N){
s+='X';
}
else{
s+='Y';
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |