# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
834183 | EntityPlantt | Combo (IOI18_combo) | C++14 | 30 ms | 416 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;
// Makes 2 calls & adds on average 2 letters
inline void checkFor(string &s, char a, char b, char c) {
int r = press(s + a + a + s + a + b + s + b + a), r2;
if (s.size() + 1 == r) {
r2 = press(s + b + b);
if (r2 == s.size() + 1) s = s + b + c;
else if (r2 == s.size()) s = s + a + c;
else s = s + b + b;
}
else if (s.size() == r) s += c;
else {
r2 = press(s + a + a);
if (r2 == s.size()) s = s + b + a;
else if (r2 == s.size() + 1) s = s + a + b;
else s = s + a + a;
}
}
inline void checkFinal(string &s, char a, char b, char c) {
if (press(s + a) > s.size()) s += a;
else if (press(s + b) > s.size()) s += b;
else s += c;
}
// Should make N+2 calls
string guess_sequence(int n) {
string s;
// Should make 2 calls
if (press("AB")) { // 1st call
if (press("A")) s = "A"; // 2nd call
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |