| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 401513 | _DaNeK_ | 콤보 (IOI18_combo) | C++17 | 0 ms | 0 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pb push_back
#define fi first
#define se second
#define bust ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll INF = INT_MAX;
const int mod = 1e9 + 7;
const int N = 1e3 + 10;
const ld eps = 1e-5;
char m[4] = {'A', 'B', 'Y', 'X'};
int press(string p)
{
    cout << p << "\n";
    int a;
    cin >> a;
    return a;
}
string guess_sequence(int N)
{
    string res = "";
    int cur = 0, i = 0, first = 0;
    while (i < 3 && press(res + m[i]) != cur + 1)
        ++i;
    res += m[i];
    first = i;
    cur = 1;
    while (res.size() < N)
    {
        int ind = 0, cnt = 0;
        bool f = true;
        while (cnt < 2 && f)
        {
            if (ind == first) continue ;
            if (press(res + m[ind]) == cur + 1)
                f = false;
            if (f)
            {
                ++cnt;
                ++ind;
            }
        }
        if (ind == first)
            ++ind;
        ++cur;
        res += m[ind];
    }
    return res;
}
int main()
{
    /*int t = 1;
    //cin >> t;
    //scanf("%d", &t);
    while (t--)
        solve();*/
    int N;
    cin >> N;
    cout << guess_sequence(N) << "\n";
    return 0;
}
