# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
777841 | JoenPoenMan | Combo (IOI18_combo) | C++17 | 58 ms | 444 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"
#include <bits/stdc++.h>
using namespace std;
char chars[4] = {'X', 'Y', 'A', 'B'};
std::string guess_sequence(int N) {
string S{};
char first;
for (char ch : chars) {
if (press(S + ch)) {
S += ch;
first = ch;
break;
}
}
for (int i = 1; i < N; i++) {
for (char ch : chars) if (ch != first) {
if (press(S + ch) == S.length()+1) {
S += ch;
break;
}
}
}
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |