Submission #392361

#TimeUsernameProblemLanguageResultExecution timeMemory
392361Urvuk3Combo (IOI18_combo)C++17
10 / 100
83 ms444 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define REP(i, n) for (int i = 0; i < (n); i++) const int M = 4; const char LET[] = "ABXY"; string guess_sequence(int N) { string s; REP(i, N) { REP(j, M-1) { int len = press(s + LET[j]); if (len == i+1) { s += LET[j]; break; } } if (s.size() != i+1) { s += LET[M-1]; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:18: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |     if (s.size() != i+1) {
      |         ~~~~~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...