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;
vector<char> b = {'A', 'B', 'X', 'Y'};
string guess_sequence(int N) {
int n = N;
string p = "";
for(int i = 0; i < 3; i++){
if(press(p + b[i])) {
p += b[i];
b.erase(b.begin() + i);
break;
}
}
if(p == ""){
p += b[3];
b.erase(b.begin() + 3);
}
for(int i = 1; i < n - 1; i++){
int x = press(p + b[0] + p + b[1] + b[0] + p + b[1] + b[1] + p + b[1] + b[2]) - p.size();
if(x == 0) p+= b[2];
if(x == 1) p+= b[0];
if(x == 2) p+= b[1];
cerr << p << "\n";
}
if(n > 1){
for(int i = 0; i < 2; i++){
cerr << p + b[i] << "\n";
if(press(p + b[i]) - p.size()) return p + b[i];
}
cerr << p + b[2] << "\n";
return p + b[2];
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |