Submission #861616

#TimeUsernameProblemLanguageResultExecution timeMemory
861616AriadnaCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB

#include <bits/stdc++.h>

using namespace std;

string first_char() {
    string s = "A";
    if (press(s)) return s;
    s = "B";
    if (press(s)) return s;
    s = "X";
    if (press(s)) return s;
    s = "Y";
    return s;
}

string guess_sequence(int N) {
    string s = first_char();
    int l = 1;
    while (l != N) {
        ++l;
        s += "A";
        if (s[0] != 'A' && press(s) == l) continue;
        s[l - 1] = 'B';
        if (s[0] != 'B' && press(s) == l) continue;
        s[l - 1] = 'X';
        if (s[0] != 'X' && press(s) == l) continue;
        s[l - 1] = 'Y';
    }
    return s;
}

Compilation message (stderr)

combo.cpp: In function 'std::string first_char()':
combo.cpp:8:9: error: 'press' was not declared in this scope
    8 |     if (press(s)) return s;
      |         ^~~~~
combo.cpp:10:9: error: 'press' was not declared in this scope
   10 |     if (press(s)) return s;
      |         ^~~~~
combo.cpp:12:9: error: 'press' was not declared in this scope
   12 |     if (press(s)) return s;
      |         ^~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:28: error: 'press' was not declared in this scope
   23 |         if (s[0] != 'A' && press(s) == l) continue;
      |                            ^~~~~
combo.cpp:25:28: error: 'press' was not declared in this scope
   25 |         if (s[0] != 'B' && press(s) == l) continue;
      |                            ^~~~~
combo.cpp:27:28: error: 'press' was not declared in this scope
   27 |         if (s[0] != 'X' && press(s) == l) continue;
      |                            ^~~~~