제출 #394347

#제출 시각아이디문제언어결과실행 시간메모리
394347iulia13콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include "combo.h" using namespace std; char dani[4] = {'A', 'B', 'X', 'Y'}; string guess_sequence(int n) { int i; if (press(s + dani[0] + dani[1]) > 0) { if (1 == press(s + dani[0])) { s += dani[0]; swap(dani[0], dani[3]); } else { s += dani[1]; swap(dani[1], dani[3]); } } else { if (1 == press(s + dani[2])) { s += dani[2]; swap(dani[2], dani[3]); } else s += dani[3]; } for (i = 2; i < n; i++) { int bebic = press(s + dani[0] + s + dani[1] + dani[0] + s + dani[1] + dani[2] + s + dani[1] + dani[1]); if (bebic == i - 1) s += dani[2]; else if (bebic == i) s += dani[0]; else s += dani[1]; } if (press(s + dani[0] + dani[1]) >= n) { if (n == press(s + dani[0])) s += dani[0]; else s += dani[1]; } else { if (n == press(s + dani[2])) s += dani[2]; else s += dani[3]; } return s; }/* int main() { cin >> S; N = S.size(); cout << guess_sequence(N); return 0; }*/

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:15: error: 's' was not declared in this scope
    9 |     if (press(s + dani[0] + dani[1]) > 0)
      |               ^
combo.cpp:34:27: error: 's' was not declared in this scope
   34 |         int bebic = press(s + dani[0] + s + dani[1] + dani[0] + s + dani[1] + dani[2] + s + dani[1] + dani[1]);
      |                           ^
combo.cpp:43:15: error: 's' was not declared in this scope
   43 |     if (press(s + dani[0] + dani[1]) >= n)
      |               ^
combo.cpp:57:12: error: 's' was not declared in this scope
   57 |     return s;
      |            ^