# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
344928 | Alma | Combo (IOI18_combo) | C++14 | 0 ms | 0 KiB |
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 <iostream>
#include <vector>
#include <string>
#include <grader.h>
#include <combo.h>
using namespace std;
string guess_sequence(int N) {
string S = "";
vector<char> buttons = {'A', 'B', 'X', 'Y'};
for (int i = 0; i < buttons.size(); i++) {
if (press(S + buttons[i]) == 1) {
S += buttons[i];
buttons.erase(buttons.begin()+i);
}
}
for (int j = 2; j <= N; j++) {
for (char c: buttons) {
if (press(S + c) == j) {S += c;}
}
}
return S;
}