# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
552280 | ctphong | Combo (IOI18_combo) | C++14 | 0 ms | 0 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<bits/stdc++.h>
using namespace std;
#define fto(i,a,b) for(int i = a; i <= b; ++i)
string s;
int out(string s) {
cout << s << endl;
fflush(stdout);
int gt; cin >> gt;
return gt;
}
int main() {
int n; cin >> n;
string gt = "";
if (out(s+"X") == 1) s = s + "X";
else if (out(s+"Y") == 1) s = s + "Y";
else if (out(s+"A") == 1) s = s + "A";
else if (out(s+"B") == 1) s = s + "B";
gt = s;
fto (i, 2, n) {
if (out(s+"X"+gt) == i) s = s + "X";
else if (out(s+"Y"+gt) == i) s = s + "Y";
else if (out(s+"A"+gt) == i) s = s + "A";
else if (out(s+"B"+gt) == i) s = s + "B";
}
cout << s << endl;
return 0;
}