제출 #1208353

#제출 시각아이디문제언어결과실행 시간메모리
1208353Aviansh콤보 (IOI18_combo)C++20
30 / 100
10 ms456 KiB
#include "combo.h"
#include <bits/stdc++.h>

using namespace std;

string guess_sequence(int n) {
    //press();
    string curr = "AB";
    int c = press(curr);
    if(c==0){
        curr="X";
        if(press(curr)==0)
            curr="Y";
    }
    else if(c == 1){
        if(press("A")){
            curr="A";
        }
        else{
            curr="B";
        }
    }
    else{
        curr="A";
    }
    //curr has first character now;
    string chars = "";
    if(curr=="A"){
        chars="BXY";
    }
    else if(curr=="B"){
        chars="AXY";
    }
    else if(curr=="X"){
        chars="ABY";
    }
    else{
        chars="ABX";
    }
    //chars has the thingies now;
    for(int i = 1;i<n;i++){
        curr+=chars[0];
        if(press(curr)==curr.size()){
            continue;
        }
        curr[curr.size()-1]=chars[1];
        if(press(curr)==curr.size()){
            continue;
        }
        curr[curr.size()-1]=chars[2];
    }
    return curr;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...