제출 #548311

#제출 시각아이디문제언어결과실행 시간메모리
548311Killer2501콤보 (IOI18_combo)C++14
10 / 100
55 ms556 KiB
#include "combo.h"
using namespace std;
using ll = long long;
using ld = long double;

const int N = 3e5 +2;
const int base = 31;
const int mod = 1e9 +7;
int a[4], k;

string guess_sequence(int n)
{
    string res;
    for(int i = 0; i < 4; i ++)a[i] = 1;
    for(int i = 1; i <= n; i ++)
    {
        if(a[0])
        {
            k = press(res+"A");
            if(k == i)
            {
                res += "A";
                if(i == 1)a[0] = 0;
                continue;
            }

        }
        if(a[1])
        {
            k = press(res+"B");
            if(k == i)
            {
                res += "B";
                if(i == 1)a[1] = 0;
                continue;
            }

        }
        if(a[2])
        {
            k = press(res+"X");
            if(k == i)
            {
                res += "X";
                if(i == 1)a[2] = 0;
                continue;
            }

        }
        if(a[3])
        {
            res += "Y";
            if(i == 1)a[3] = 0;
        }
    }
    return res;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...