제출 #500055

#제출 시각아이디문제언어결과실행 시간메모리
500055LucaIlieCombo (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <iostream> #include "combo.h" using namespace std; string guess_sequence( int n ) { int i; string ans; for ( i = 1; i <= n; i++ ) { if ( (i == 1 || ch[0] != 'A') && press( ans + 'A' ) == i ) ans += 'A'; else if ( (i == 1 || ch[1] != 'B') && press( ans + 'B' ) == i ) ans += 'B'; else if ( (i == 1 || ch[2] != 'X') && press( ans + 'X' ) == i ) ans += 'X'; else ans += 'Y'; } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:25: error: 'ch' was not declared in this scope
   12 |         if ( (i == 1 || ch[0] != 'A') && press( ans + 'A' ) == i )
      |                         ^~