# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
348560 | Halogen | Combo (IOI18_combo) | C++14 | 44 ms | 680 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 "combo.h"
std::string guess_sequence(int N) {
char lst[4] = {'A', 'B', 'X', 'Y'};
std::string p = "";
if (press(lst[0] + p + lst[1]) >= 1) {
if (press(p + lst[0]) == 1){
p += lst[0];
lst[0] = lst[3];
}
else {
p += lst[1];
lst[1] = lst[3];
}
}
else if (press(p + lst[2]) == 1) {
p += lst[2];
lst[2] = lst[3];
}
else {
p += lst[3];
}
for (int j = 2; j < N; j++) {
int result = press(p + lst[0] + p + lst[1] + lst[0] + p + lst[1] + lst[1] + p + lst[1] + lst[2]);
if (result == j) p += lst[0];
else if (result == j + 1) p += lst[1];
else p += lst[2];
}
if (p.size() == N) return p;
else if (press(p + lst[2]) == N) p += lst[2];
else if (press(p + lst[0]) == N) p += lst[0];
else p += lst[1];
return p;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |