제출 #294573

#제출 시각아이디문제언어결과실행 시간메모리
294573MilosMilutinovic콤보 (IOI18_combo)C++14
10 / 100
57 ms592 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string ans = ""; for (int i = 0; i < N; i++) { if (press(ans + 'A') > ans.length()) { ans += 'A'; } else { if (press(ans + 'B') > ans.length()) { ans += 'B'; } else { if (press(ans + 'X') > ans.length()) { ans += 'X'; } else { ans += 'Y'; } } } } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:30: 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(ans + 'A') > ans.length()) {
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:12:34: 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 (press(ans + 'B') > ans.length()) {
      |                 ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:15:38: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |                 if (press(ans + 'X') > ans.length()) {
      |                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...