제출 #705898

#제출 시각아이디문제언어결과실행 시간메모리
705898mseebacher콤보 (IOI18_combo)C++17
10 / 100
62 ms456 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:20: 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: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: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: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){
      |            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...