제출 #570640

#제출 시각아이디문제언어결과실행 시간메모리
570640kkkkkkkk콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> using namespace std; string guess_sequence(int N) { string rez; char prva; if (press("AB")) { if (press("A")) rez="A",prva='A'; else rez="B",prva='B'; } else { if (press("X")) rez="X",prva='X'; else rez="Y",prva='Y'; } for (int i=1;i<N;i++) { if (prva=='A') { if (press(rez+"B")==rez.size()+1) rez+="B"; else if (press(rez+"X")==rez.size()+1) rez+="X"; else rez+="Y"; } else if (prva=='B') { if (press(rez+"A")==rez.size()+1) rez+="A"; else if (press(rez+"X")==rez.size()+1) rez+="X"; else rez+="Y"; } else if (prva=='X') { if (press(rez+"A")==rez.size()+1) rez+="A"; else if (press(rez+"B")==rez.size()+1) rez+="B"; else rez+="Y"; } else { if (press(rez+"A")==rez.size()+1) rez+="A"; else if (press(rez+"B")==rez.size()+1) rez+="B"; else rez+="X"; } } return rez; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:9: error: 'press' was not declared in this scope
   10 |     if (press("AB"))
      |         ^~~~~
combo.cpp:28:17: error: 'press' was not declared in this scope
   28 |             if (press(rez+"B")==rez.size()+1)
      |                 ^~~~~
combo.cpp:37:17: error: 'press' was not declared in this scope
   37 |             if (press(rez+"A")==rez.size()+1)
      |                 ^~~~~
combo.cpp:46:17: error: 'press' was not declared in this scope
   46 |             if (press(rez+"A")==rez.size()+1)
      |                 ^~~~~
combo.cpp:55:17: error: 'press' was not declared in this scope
   55 |             if (press(rez+"A")==rez.size()+1)
      |                 ^~~~~