제출 #348545

#제출 시각아이디문제언어결과실행 시간메모리
348545Halogen콤보 (IOI18_combo)C++14
30 / 100
67 ms556 KiB
#include "combo.h" std::string guess_sequence(int N) { char lst[4] = {'A', 'B', 'X', 'Y'}; std::string p = ""; int first = 4; for (int j = 0; j < N; j++) { if (press(p + lst[0] + p + lst[1]) >= p.size() + 1) { if (press(p + lst[0]) == p.size() + 1) p += lst[0]; else p += lst[1]; } else if (press(p + lst[2]) == p.size() + 1) p += lst[2]; else p += lst[3]; } return p; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:40: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     if (press(p + lst[0] + p + lst[1]) >= p.size() + 1) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:10:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |         if (press(p + lst[0]) == p.size() + 1) p += lst[0];
      |             ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:13:32: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     else if (press(p + lst[2]) == p.size() + 1) p += lst[2];
      |              ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:6:7: warning: unused variable 'first' [-Wunused-variable]
    6 |   int first = 4;
      |       ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...