제출 #1006800

#제출 시각아이디문제언어결과실행 시간메모리
1006800GTA콤보 (IOI18_combo)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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;
      |          ^