# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
95701 | shenxy | Combo (IOI18_combo) | C++11 | 85 ms | 424 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 <string>
#include <algorithm>
using namespace std;
string guess_sequence(int N) {
string p = "";
int K;
char firstchar = ' ';
for (int i = 1; i <= N; ++i) {
p += "A";
if (i == 1 || firstchar != 'A') K = press(p);
if (K < i) {
p.pop_back();
p += "B";
} else {
if (i == 1) firstchar = 'A';
continue;
}
if (i == 1 || firstchar != 'B') K = press(p);
if (K < i) {
p.pop_back();
if (firstchar == 'Y') {
p += "X";
continue;
}
if (i == 1 || firstchar != 'X') p += "X";
else {
p += "Y";
continue;
}
} else {
if (i == 1) firstchar = 'B';
continue;
}
K = press(p);
if (K < i) {
p.pop_back();
p += "Y";
if (i == 1) firstchar = 'Y';
} else if (i == 1) firstchar = 'X';
}
return p;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |