| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 426621 | Mazaalai | Combo (IOI18_combo) | C++14 | 1 ms | 200 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;
string guess_sequence(int N) {
string chars1 = "ABXY", chars, ans = "", p, p1;
// first char
int val, k;
{
p = "AB";
val = press(p);
if (val == 2) {
ans += p;
} else {
if (val == 1) p = "A", p1 = "B";
else p = "X", p1 = "Y";
val = press(p);
if (val) ans += p;
else ans += p1;
}
}
for (auto el : chars1) {
if (el == ans[0]) continue;
chars += el;
}
char x = chars1[0], y = chars1[1], z = chars1[2];
while (ans.size()+2 <= N) {
p = ans+x+x+ans+x+y+ans+x+z+ans+y;
k = ans.size();
val = press(p);
if (val == k) {
ans += z;
} else if (val == k+1) {
ans += y;
} else {
ans += x;
}
}
if (ans.size() < N) {
p = ans+x;
k = ans.size();
val = press(p);
if (val == k+1) {
ans += x;
} else {
p = ans+y;
val = press(p);
if (val == k+1) ans+= y;
else ans += z;
}
}
return ans;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
