Submission #95681

#TimeUsernameProblemLanguageResultExecution timeMemory
95681shenxyCombo (IOI18_combo)C++11
10 / 100
105 ms424 KiB
#include "combo.h"
#include <string>
#include <algorithm>
using namespace std;
string guess_sequence(int N) {
    string p = "";
    int K = -1;
    char firstchar = ' ';
    for (int i = 1; i <= N; ++i) {
        p += "A";
        if (i == 1 || firstchar != 'A') K = press(p);
        if (K < i) {
            p.pop_back();
            p += "B";
        } else {
            if (i == 1) firstchar = 'A';
            continue;
        }
        if (i == 1 || firstchar != 'B') K = press(p);
        if (K < i) {
            p.pop_back();
            p += "X";
        } else {
            if (i == 1) firstchar = 'B';
            continue;
        }
        if (i == 1 || firstchar != 'X') K = press(p);
        if (K < i) {
            p.pop_back();
            p += "Y";
            firstchar = 'Y';
        } else if (i == 1) firstchar = 'X';
    }
    return p;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...