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 <set>
#include <iostream>
using namespace std;
string guess_sequence(int N) {
string S = "";
set<char> a = {'A', 'B', 'X', 'Y'};
string p = "";
for (auto& c : a){
p = "";
p += c;
int coins = press(p);
if (coins == 1){
S += c;
a.erase(c);
break;
}
}
while ((int) S.size() < N){
for (auto& c : a){
p = S;
p += c;
int coins = press(p);
if (coins == (int) S.size()+1){
S += c;
break;
}
}
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |