제출 #303831

#제출 시각아이디문제언어결과실행 시간메모리
303831Gilgamesh콤보 (IOI18_combo)C++17
0 / 100
1 ms200 KiB
#include "combo.h"

std::string guess_sequence(int N) {
    std::string ans = "";
    for(int i = 0; i < N; ++i){
        std::string ab = ans + "A";
        for(int j = 0; j < N; ++j){
            ab += "A";
        }
        ab += ans + "B";
        int curab = press(ab);
        if(curab == i + 1){
            int a = press(ans + "A");
            if(a == i + 1){
                ans += "A";
            }
            else ans += "B";
        } else{
            int x = press(ans + "X");
            if(x == i + 1){
                ans += "X";
            }
            else ans += "Y";
        }
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...