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;
string guess_sequence(int n) {
string s = "";
string c = "";
if(press("AB")) {
if(press("A")) c = "BXY", s = "A";
else c = "AXY", s = "B";
} else {
if(press("X")) c = "ABY", s = "X";
else c = "ABX", s = "Y";
}
if(n == 1) return s;
for(int i = 1; i < n-1; i++) {
int k = press(s+c[0]+c[0]+s+c[0]+c[1]+s+c[0]+c[2]+s+c[1]);
if(k == i+2) s += c[0];
if(k == i+1) s += c[1];
if(k == i) s += c[2];
}
if(press(s+c[0]) == n) return s + c[0];
if(press(s+c[1]) == n) return s + c[1];
return s + c[2];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |