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 <bits/stdc++.h>
#define forint(i, N) for (int i = 0; i < (N); i++)
using namespace std;
int press(string p);
string test = "ABBBXXYX";
string guess_sequence(int N) {
string ans = "";
if (press("A") == 1) {
ans += 'A';
}
if (press("B") == 1) {
ans += 'B';
}
if (press("X") == 1) {
ans += 'X';
}
if (press("Y") == 1) {
ans += 'Y';
}
//int pos = 1;
for (int i = 1; i < N; i++) {
if (ans[0] != 'A') {
if (press(ans + 'A') == i + 1) {
ans += 'A';
continue;
}
}
if (ans[0] != 'B') {
if (press(ans + 'B') == i + 1) {
ans += 'B';
continue;
}
}
if (ans[0] != 'X') {
if (press(ans + 'X') == i + 1) {
ans += 'X';
continue;
}
}
if (ans[0] != 'Y') {
if (press(ans + 'Y') == i + 1) {
ans += 'Y';
continue;
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |