제출 #82729

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

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:8: error: 'press' was not declared in this scope
    9 |     if(press("AB")!=0)
      |        ^~~~~
combo.cpp:38:19: error: 'press' was not declared in this scope
   38 |         int value=press(q);
      |                   ^~~~~
combo.cpp:41:8: error: 'press' was not declared in this scope
   41 |     if(press(sl+ch[0])==n)
      |        ^~~~~