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 oo 10000000000007
#define sci(x) scanf("%d", &x)
#define scii(x, y) scanf("%d %d", &x, &y)
#define pri(x) printf("%d ", x)
#define pril(x) printf("%d\n", x)
#define ii pair<int, int>
#define ff first
#define ss second
#define vi vector<int>
#define vii vector<ii>
#define pb push_back
#define mp make_pair
#define ll long long
#define fto(i, a, b) for (int i = a; i <= b; ++i)
#define fdto(i, a, b) for (int i = a; i >= b; --i)
#define maxN 100005
using namespace std;
int n, m;
char a[] = {'A', 'B', 'X', 'Y'};
int press(string s);
string guess_sequence(int n) {
string s = " ";
fto(i, 0, 3) {
s[0] = a[i];
// cout << s << endl;
if(press(s) == 1) break;
}
char first = s[0];
fto(i, 1, n-1) {
s = s + ' ';
fto(j, 0, 3) {
if(a[j] == first) continue;
s[i] = a[j];
int coin = press(s);
if(coin == i+1) {
break;
}
}
}
return s;
}
//int main() {
// cin >> n;
// cout << guess_sequence(n);
//
//
//}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |