제출 #588916

#제출 시각아이디문제언어결과실행 시간메모리
588916MahtimursuCombo (IOI18_combo)C++17
30 / 100
60 ms536 KiB
#include "combo.h"

using namespace std;

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

string guess_sequence(int N) {
    string p = "";
    
    while ((int)p.length() < N) {
        int tre = 0;
        bool ok = 0;
        for (char c : opt) {
            if (p.length() > 0 && c == p[0]) continue;

            if (ok || press(p + c) == (int)p.length() + 1) {
                p += c;
                break;
            } else tre++;

            if (p.length() > 0 && tre == 2) ok = 1;
            if (p.length() == 0 && tre == 3) ok = 1;
        }
    }

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