제출 #155588

#제출 시각아이디문제언어결과실행 시간메모리
155588bukanYohandi콤보 (IOI18_combo)C++14
30 / 100
81 ms576 KiB
#include <bits/stdc++.h> #include "combo.h" std::string guess_sequence(int N) { int coins,piv; std::string S = ""; while(S.length()<N){ piv=S.length(); coins=press(S+'A'+S+'B'); if(coins>piv){ coins=press(S+'A'); if(coins>S.length()) S+="A"; else S+="B"; } else { coins=press(S+'X'); if(coins>S.length()) S+="X"; else S+="Y"; } } return S; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:19: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    7 |   while(S.length()<N){
      |         ~~~~~~~~~~^~
combo.cpp:12:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     if(coins>S.length()) S+="A";
      |        ~~~~~^~~~~~~~~~~
combo.cpp:16:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     if(coins>S.length()) S+="X";
      |        ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...