제출 #232262

#제출 시각아이디문제언어결과실행 시간메모리
232262pere_gil콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <iostream>
#include "combo.h"

using namespace std;

int guess_sequence(int N)
{
    string s="";
    for(int i=0;i<N;i++){
    if(press(s+"A")>0){
        s+="A";
    }
    else{
        if(press(s+"B")>0){
            s+="B";
        }
        else{
            if(press(s+"X")>0){
                s+="X";
            }
            else{
                s+="Y";
            }
        }
    }
    }
    return s;
}

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

combo.cpp:6:5: error: ambiguating new declaration of 'int guess_sequence(int)'
    6 | int guess_sequence(int N)
      |     ^~~~~~~~~~~~~~
In file included from combo.cpp:2:
combo.h:5:13: note: old declaration 'std::string guess_sequence(int)'
    5 | std::string guess_sequence(int N);
      |             ^~~~~~~~~~~~~~
combo.cpp: In function 'int guess_sequence(int)':
combo.cpp:27:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in return
   27 |     return s;
      |            ^