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;
std::string guess_sequence(int N) {
string can = "ABXY";
char first;
string res = "";
if(press("AB")){
if(press("A") == 1){
first = 'A';
}
else {
first = 'B';
}
}else{
if(press("X") == 1){
first = 'X';
}else{
first = 'Y';
}
}
// cout << first << endl;
res += first;
if(N == 1)return res;
can.erase(can.find(first),1);
// for(char c : can)cout << c << endl;
for(int i = 2 ; i < N ; ++i){
int Now = press(res + can[0] + res + can[1] + can[0] + res + can[1] + can[1] + res + can[1] + can[2]);
if(Now == i - 1){
res += can[2];
}else if(Now == i){
res += can[0];
}else if(Now == i + 1)res += can[1];
else assert(0);
}
if(press(res + can[0]) == N)res += can[0];
else if(press(res + can[1]) == N)res += can[1];
else res += can[2];
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |