Submission #348298

#TimeUsernameProblemLanguageResultExecution timeMemory
348298HalogenCombo (IOI18_combo)C++14
10 / 100
71 ms428 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++) { bool check = false; for (int i = 0; i < 4; ++i) { if (i == first) continue; if (press(p + lst[i]) != p.size() + 1) continue; check = true; if (j == 0) first = i; p += lst[i]; break; } if (!check) return p; } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:26: 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(p + lst[i]) != p.size() + 1) continue;
      |        ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...