제출 #1196418

#제출 시각아이디문제언어결과실행 시간메모리
1196418ffeyyaae_Combo (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include combo.h using namespace std; string guess_sequence( int N ) { string s = ""; string a = "ABXY", bt = ""; if( press("A") ) s += "A"; else if( press("B") ) s += "B"; else if( press("X") ) s += "X"; else s += "Y"; if( N == 1 ) return s; for( auto c : a ) if( s != a ) bt += c; for( int i=1;i<N;i++ ) { string tp = s+bt[0] + s+bt[1]+bt[0] + s+bt[1]+bt[1] + s+bt[1]+bt[2]; if( press(tp) == 1 ) s += bt[0]; else if( press(tp) == 2 ) s += bt[1]; else s += bt[2]; } if( press(s+bt[0]) ) s += bt[0]; else if( press(s+bt[1]) ) s += bt[1]; else s += bt[2]; return s; }

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

combo.cpp:2:10: error: #include expects "FILENAME" or <FILENAME>
    2 | #include combo.h
      |          ^~~~~
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:9: error: 'press' was not declared in this scope
   10 |     if( press("A") ) s += "A";
      |         ^~~~~
combo.cpp:19:13: error: 'press' was not declared in this scope
   19 |         if( press(tp) == 1 ) s += bt[0];
      |             ^~~~~
combo.cpp:23:9: error: 'press' was not declared in this scope
   23 |     if( press(s+bt[0]) ) s += bt[0];
      |         ^~~~~