제출 #415192

#제출 시각아이디문제언어결과실행 시간메모리
415192aris12345678Combo (IOI18_combo)C++14
5 / 100
2 ms200 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;

const int mxN = 2005;

string guess_sequence(int n) {
    string p = "", comb;
    if(press("A") == 1)
        p = "A", comb = "BXY";
    else if(press("B") == 1)
        p = "B", comb = "AXY";
    else if(press("X") == 1)
        p = "X", comb = "ABY";
    else
        p = "Y", comb = "ABX";
    for(int i = 2; i < n; i++) {
        int match = press(p+comb[0]+p+comb[1]+comb[0]+p+comb[1]+comb[1]+p+comb[1]+comb[2]);
        if(match == i-1)
            p += comb[2];
        else if(match == i)
            p += comb[0];
        else
            p += comb[1];
    }
    if(press(p+comb[0]) == n)
        p += comb[0];
    else if(press(p+comb[1]) == n)
        p += comb[1];
    else
        p += comb[2];
    return p;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...