Submission #763102

#TimeUsernameProblemLanguageResultExecution timeMemory
763102t6twotwoCombo (IOI18_combo)C++17
30 / 100
37 ms464 KiB
#include "combo.h"
using namespace std;
string a[] = {"A", "B", "X", "Y"};
std::string guess_sequence(int N) {
    int f = 0;
    if (press("AB")) {
        f = press("B");
    } else {
        f = press("Y") + 2;
    }
    string ans = a[f];
    string x = a[f == 0 ? 1 : 0];
    string y = a[f <= 1 ? 2 : 1];
    string z = a[f == 3 ? 2 : 3];
    for (int i = 1; i < N; i++) {
        // int t = press(ans + x + ans + y + x + ans + y + y + ans + y + z);
        // if (t == i + 1) {
        //     ans = ans + x;
        // } else if (t == i + 2) {
        //     ans = ans + y;
        // } else {
        //     ans = ans + z;
        // }
        if (press(ans + x) == i + 1) {
            ans = ans + x;
        } else if (press(ans + y) == i + 1) {
            ans = ans + y;
        } else {
            ans = ans + z;
        }
    }
    // if (press(ans + x) == N) {
    //     ans = ans + x;
    // } else if (press(ans + y) == N) {
    //     ans = ans + y;
    // } else {
    //     ans = ans + z;
    // }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...