제출 #562420

#제출 시각아이디문제언어결과실행 시간메모리
5624201zaid1콤보 (IOI18_combo)C++17
10 / 100
71 ms440 KiB
#include "combo.h" using namespace std; std::string guess_sequence(int n) { std::string cum = ""; for (int i = 0; i < n; i++) { int a = press(cum+"A"); if (a == cum.size()+1) { cum += 'A'; continue; } a = press(cum+"B"); if (a == cum.size()+1) { cum += 'B'; continue; } a = press(cum+"Y"); if (a == cum.size()+1) { cum += 'Y'; continue; } cum += 'X'; } return cum; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |         if (a == cum.size()+1) {
      |             ~~^~~~~~~~~~~~~~~
combo.cpp:13:15: 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 (a == cum.size()+1) {
      |             ~~^~~~~~~~~~~~~~~
combo.cpp:19:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |         if (a == cum.size()+1) {
      |             ~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...