제출 #286966

#제출 시각아이디문제언어결과실행 시간메모리
286966infinite_iq콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std ; //#include "combo.h" int n ; string ans , but = "ABXY" , ret ; int query ( string s ) { return press (s) ; } void solve () { string crnt = "" ; for ( int i = 0 ; i < 3 ; i ++ ) { crnt += ans ; crnt += ret [0] ; crnt += ret [i] ; } crnt += ans ; crnt += ret [1] ; int x = query ( crnt ) ; x -= ans .size () ; if ( x == 0 ) { ans += ret [2] ; } if ( x == 1 ) { ans += ret [1] ; } if ( x == 2 ) { ans += ret [0] ; } } string guess_sequence ( int N ) { n = N ; if ( query ( "AB" ) ) { if ( query ( "A" ) ) ans += 'A' ; else ans += 'B' ; } else { if ( query ( "X" ) ) ans += 'X' ; else ans += 'Y' ; } for ( int i = 0 ; i < 4 ; i ++ ) { if ( but [i] != ans [0] ) ret += but [i] ; } for ( int i = 1 ; i < n - 1 ; i ++ ) solve () ; string crnt = "" ; crnt += ans ; crnt += ret [0] ; crnt += ans ; crnt += ret [1] ; if ( query ( crnt ) - ans .size () == 0 ) { ans += ret [2] ; } else { crnt = "" ; crnt += ans ; crnt += ret [0] ; if ( query ( crnt ) - ans .size () == 0 ) { ans += ret [1] ; } else ans += ret [0] ; } return ans ; }

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

combo.cpp: In function 'int query(std::string)':
combo.cpp:7:16: error: 'press' was not declared in this scope
    7 |         return press (s) ;
      |                ^~~~~