Submission #545662

#TimeUsernameProblemLanguageResultExecution timeMemory
545662aun5xCombo (IOI18_combo)C++14
10 / 100
54 ms548 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string p = "ABXY"; char out = 'Z'; string guess = ""; while (guess.size() != N) { for (char c: p) { if (c != out) { int res = press(guess+c); if (res - guess.size() == 1){ guess += c; if (guess.size() == 1) out = c; break; } } } } return guess; }

Compilation message (stderr)

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