제출 #636396

#제출 시각아이디문제언어결과실행 시간메모리
636396SonCombo (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

string guessing( int n ){
    string ans = "";
    for ( int i = 1; i <= n; i++ ){
        string t = ans + "A";
        if ( press(t) == i ) {
            ans += "A";
            continue;
        }

        t = ans + "B";
        if ( press(t) == i ){
            ans += "B";
            continue;
        }

        t = ans + "X";
        if ( press(t) == i ){
            ans += "X";
            continue;
        }

        ans += "Y";
    }
    return ans;
}

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

combo.cpp: In function 'std::string guessing(int)':
combo.cpp:8:14: error: 'press' was not declared in this scope
    8 |         if ( press(t) == i ) {
      |              ^~~~~
combo.cpp:14:14: error: 'press' was not declared in this scope
   14 |         if ( press(t) == i ){
      |              ^~~~~
combo.cpp:20:14: error: 'press' was not declared in this scope
   20 |         if ( press(t) == i ){
      |              ^~~~~