Submission #1170627

#TimeUsernameProblemLanguageResultExecution timeMemory
1170627azure콤보 (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

string guess_sequence(int N) {
    vector<string> guys = {"A", "B", "X", "Y"};

    string s = "";

    for (int i = 1; i < 4; i++) {
        if (press(guys[i])) {
            swap(guys[0], guys[i]);
            break;
        }
    }

    s += guys[0];

    for (int i = 1; i < N; i++) {
        string t = s + guys[2];

        for (int i = 1; i < 4; i++) {
            t += guys[3] + guys[i];
        }

        s += guys[press(t)-i+1];
    }

    return s;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:13: error: 'press' was not declared in this scope
   10 |         if (press(guys[i])) {
      |             ^~~~~
combo.cpp:25:19: error: 'press' was not declared in this scope
   25 |         s += guys[press(t)-i+1];
      |                   ^~~~~