Submission #1009396

#TimeUsernameProblemLanguageResultExecution timeMemory
1009396IncreedibleCombo (IOI18_combo)C++14
10 / 100
47 ms940 KiB
#include "combo.h" #include <string> using namespace std; string guess_sequence(int N) { string s = ""; int oldcoins = 0; while (s.size() < N) { if (press(s + "A") > oldcoins) { oldcoins++; s += "A"; } else if (press(s + "B") > oldcoins) { oldcoins++; s += "B"; } else if (press(s + "X") > oldcoins) { oldcoins++; s += "X"; } else if (press(s + "Y") > oldcoins) { oldcoins++; s += "Y"; } } return s; }

Compilation message (stderr)

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