제출 #705895

#제출 시각아이디문제언어결과실행 시간메모리
705895mseebacher콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int n) { string s = ""; while(s.length() != N){ if(press(s+"A") == s.length()+1)){ s += "A"; }else if(press(s+"B") == s.length()+1)){ s += "B"; }else if(press(s+"X") == s.length()+1)){ s += "X"; }else{ s += "Y"; } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:23: error: 'N' was not declared in this scope
    7 |   while(s.length() != N){
      |                       ^
combo.cpp:8:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |   if(press(s+"A") == s.length()+1)){
      |      ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:8:35: error: expected primary-expression before ')' token
    8 |   if(press(s+"A") == s.length()+1)){
      |                                   ^
combo.cpp:10:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |   }else if(press(s+"B") == s.length()+1)){
      |            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:10:41: error: expected primary-expression before ')' token
   10 |   }else if(press(s+"B") == s.length()+1)){
      |                                         ^
combo.cpp:12:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   }else if(press(s+"X") == s.length()+1)){
      |            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:12:41: error: expected primary-expression before ')' token
   12 |   }else if(press(s+"X") == s.length()+1)){
      |                                         ^