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;
int press(string p);
// cout << p << endl;
// int res; cin >> res;
// return res;
//}
string guess_sequence(int n) {
string p = "A";
char a[] = {'A', 'B', 'X', 'Y'};
int s = 0;
while (1) {
int x = press(p);
if (x == 1) {
swap(a[s], a[3]);
break;
}
++s;
p = a[s];
}
string S = p;
fto(i, 2, n) {
int j = 0;
p = S + a[j];
while (press(p) != i) {
++j;
p = S + a[j];
}
S = p;
}
return S;
}
//int main() {
// sci(n);
//
// cout << guess_sequence(n);
//
// return 0;
//}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |