제출 #771050

#제출 시각아이디문제언어결과실행 시간메모리
771050nnin콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string S; string opt; if(press("AB")) { if(press("A")) { S = "A"; opt = "BXY"; } else { S = "B"; opt = "AXY"; } } else { if(press("X")) { S = "X"; opt = "ABY"; } else { S = "Y"; opt = "ABX"; } } for(int i=1;i<N-1;i++) { /*if(press(S+opt[0])>i) { S += opt[0]; } else if(press(S+opt[1])>i) { S += opt[1]; } else { S += opt[2]; }*/ string tmp = S+opt[0]+opt[0]+S+opt[0]+opt[1]+S+opt[0]+opt[2]+S+opt[1]; int ct = press(tmp); if(ct>i+1) { S += opt[0]; } else if(ct==i+1) { S += opt[1]; } else { S += opt[2]; } } if(press(S+opt[0])==N) { S += opt[0]; } else if(press(S+opt[1])==N) { S += opt[1]; } else { S += opt[2]; } return S; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:6: error: 'press' was not declared in this scope
    7 |   if(press("AB")) {
      |      ^~~~~
combo.cpp:34:16: error: 'press' was not declared in this scope
   34 |       int ct = press(tmp);
      |                ^~~~~
combo.cpp:43:8: error: 'press' was not declared in this scope
   43 |     if(press(S+opt[0])==N) {
      |        ^~~~~