# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
335431 |
2020-12-12T15:51:50 Z |
madlogic |
Combo (IOI18_combo) |
C++17 |
|
1 ms |
204 KB |
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string str = "ABXY", ans;
for (int i = 0; i < 3; i++) {
string s;
s += str[i];
if (press(s)) {
ans += str[i];
break;
}
}
if (ans.empty()) {
ans += str[3];
}
string nstr;
for (char& c : str) {
if (c != ans[0]) {
nstr += c;
}
}
str = nstr;
for (int i = 1; i < N; i++) {
if (i == N - 1) {
bool found = false;
for (int i = 0; i < 2; i++) {
string s = ans + str[i];
if (press(s)) {
ans += str[i];
found = true;
break;
}
}
if (!found) {
ans += str[2];
}
} else {
string checker = ans + nstr[0] + ans + nstr[1] + nstr[0] + ans + nstr[1] +
nstr[1] + ans + nstr[1] + nstr[2];
int res = press(checker);
if (res == i) {
ans += nstr[2];
} else if (res == i + 1) {
ans += nstr[0];
} else {
ans += nstr[1];
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
200 KB |
Wrong Answer: wrong guess. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
200 KB |
Output is correct |
2 |
Correct |
1 ms |
200 KB |
Output is correct |
3 |
Correct |
0 ms |
200 KB |
Output is correct |
4 |
Correct |
1 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
200 KB |
Output is correct |
6 |
Incorrect |
1 ms |
200 KB |
Wrong Answer: wrong guess. |
7 |
Halted |
0 ms |
0 KB |
- |