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