Submission #303838

#TimeUsernameProblemLanguageResultExecution timeMemory
303838Gilgamesh콤보 (IOI18_combo)C++17
30 / 100
69 ms592 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){
            if(i) ab += "" + ab[0];
        }
        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...