# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
299727 | tzero | Combo (IOI18_combo) | C++14 | 78 ms | 428 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"
using namespace std;
char guess_next(string & S, int N) {
int len = S.size();
int checked = 0;
for(char c : { 'A', 'B', 'X', 'Y'}) {
if(len > 0 && c == S[0]) continue;
if(checked == 2 && len > 0) return c;
std::string s = S;
for(int i = len; i < N; i++) {
s += c;
}
int coins = press(s);
if(coins > len) return c;
else checked++;
}
}
std::string guess_sequence(int N) {
std::string S = "";
for(int i = 0; i < N; i++) {
S += guess_next(S, N);
}
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |