Submission #1006800

#TimeUsernameProblemLanguageResultExecution timeMemory
1006800GTACombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h"
using namespace std;
#define fr(m,n,k) for(int m=n;m<=k;m++)

string guess_sequence(int N) {
  n = N;
  vector<char> v(4) = {'A', 'B', 'X', 'Y'};
  fr(i, 0, 3) {
    fr(j, 0, 3) {
      fr(l, 0, 3) {
        string p = v[i] + v[j] + v[l];
        x = press(p);
        if (x == 3) {
          return p;
        }
      }
    }
  }
  return S;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:6:3: error: 'n' was not declared in this scope
    6 |   n = N;
      |   ^
combo.cpp:7:3: error: 'vector' was not declared in this scope
    7 |   vector<char> v(4) = {'A', 'B', 'X', 'Y'};
      |   ^~~~~~
combo.cpp:2:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    1 | #include "combo.h"
  +++ |+#include <vector>
    2 | using namespace std;
combo.cpp:7:10: error: expected primary-expression before 'char'
    7 |   vector<char> v(4) = {'A', 'B', 'X', 'Y'};
      |          ^~~~
combo.cpp:11:20: error: 'v' was not declared in this scope
   11 |         string p = v[i] + v[j] + v[l];
      |                    ^
combo.cpp:12:9: error: 'x' was not declared in this scope
   12 |         x = press(p);
      |         ^
combo.cpp:19:10: error: 'S' was not declared in this scope
   19 |   return S;
      |          ^