Submission #588915

#TimeUsernameProblemLanguageResultExecution timeMemory
588915ollpuCombo (IOI18_combo)C++17
30 / 100
59 ms472 KiB
#include "combo.h" using namespace std; std::string guess_sequence(int N) { string S; for (int i = 0; i < N; ++i) { string p = S; p.push_back('A'); p.insert(p.end(), S.begin(), S.end()); p.push_back('B'); if (press(p) > S.size()) { p = S; p.push_back('A'); if (press(p) > S.size()) S.push_back('A'); else S.push_back('B'); } else { p = S; p.push_back('X'); if (press(p) > S.size()) S.push_back('X'); else S.push_back('Y'); } } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:18: 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(p) > S.size()) {
      |         ~~~~~~~~~^~~~~~~~~~
combo.cpp:14:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |       if (press(p) > S.size()) S.push_back('A');
      |           ~~~~~~~~~^~~~~~~~~~
combo.cpp:19:20: 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 (press(p) > S.size()) S.push_back('X');
      |           ~~~~~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...