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;
string guess_sequence(int N) {
vector<string> letters = {"A", "B", "X", "Y"};
string rez = "";
for(vector<string>::iterator i=letters.begin(); i!=letters.end(); i++)
if(press(*i)) {
rez = rez + *i;
letters.erase(i);
break;
}
for(int i=1; i<N; i++) {
//cout << rez + letters[0] << " " << press(rez+letters[0]) << "\n";
//cout << rez + letters[1] << " " << press(rez+letters[1]) << "\n";
//cout << rez + letters[2] << " " << press(rez+letters[2]) << "\n\n";
if(press(rez+letters[0])==i+1) rez = rez + letters[0];
else if(press(rez+letters[1])==i+1) rez = rez + letters[1];
else rez = rez + letters[2];
}
return rez;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |