제출 #750958

#제출 시각아이디문제언어결과실행 시간메모리
750958B_Shahrom콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include<iostream>
using namespace std;

string guess_sequence(int N)
{
    string last="";
    string mx="ABXY";
    while (last.size()!=N){
        for (int i=0; i<4; i++){
            string tl=last+mx[i];
            int d=press(tl);
            //cout<<d<<endl;
            if (d==tl.size()){
                last+=mx[i];
                break;
            }
        }
        //cout<<last<<endl;
    }
    return last;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:8:23: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    8 |     while (last.size()!=N){
      |            ~~~~~~~~~~~^~~
combo.cpp:11:19: error: 'press' was not declared in this scope
   11 |             int d=press(tl);
      |                   ^~~~~
combo.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |             if (d==tl.size()){
      |                 ~^~~~~~~~~~~