제출 #1339883

#제출 시각아이디문제언어결과실행 시간메모리
1339883chry콤보 (IOI18_combo)C++20
10 / 100
16 ms456 KiB
#include <bits/stdc++.h>
using namespace std;

char choices[4] = {'A', 'B', 'X', 'Y'};

int press(string p);

string guess_sequence(int N) {
    string S = "";
    int now = 1;
    int fst = 0;

    if (press("AB") > 0) {
        if (press("A") > 0) {
            S += 'A';
            fst = 0;
        } else {
            S += 'B';
            fst = 1;
        }
    } else {
        if (press("X") > 0) {
            S += 'X';
            fst = 2;
        } else {
            S += 'Y';
            fst = 3;
        }
    }

    while (now != N) {
        for (int i = 0; i < 4; i++) {
            if (i==fst) continue;

            if (press(S+choices[i]) > now) {
                now++;
                S += choices[i];
                continue;
            }
        }
    }

    return S;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...