제출 #534395

#제출 시각아이디문제언어결과실행 시간메모리
534395YaserFaisal콤보 (IOI18_combo)C++17
10 / 100
91 ms528 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence (int n) { string cur = "" ; while(cur.size()<n) { if ( press(cur+'A') == cur.size()+1 ) { cur+='A' ; continue ; } if ( press(cur+'B') == cur.size()+1 ) { cur+='B' ; continue ; } if ( press(cur+'X') == cur.size()+1 ) { cur+='X' ; continue ; } if ( press(cur+'Y') == cur.size()+1 ) { cur+='Y' ; continue ; } } return cur ; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    9 |     while(cur.size()<n)
      |           ~~~~~~~~~~^~
combo.cpp:11:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |         if ( press(cur+'A') == cur.size()+1 )
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:16:29: 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 ( press(cur+'B') == cur.size()+1 )
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:21:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |         if ( press(cur+'X') == cur.size()+1 )
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:26:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |         if ( press(cur+'Y') == cur.size()+1 )
      |              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...