Submission #585236

#TimeUsernameProblemLanguageResultExecution timeMemory
585236haxormanCombo (IOI18_combo)C++14
10 / 100
56 ms556 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string guess; set<char> letters = {'A', 'B', 'X', 'Y'}; while (guess.size() < N) { for (char c : letters) { guess += c; int coins = press(guess); if (coins == guess.size()) { break; } guess.pop_back(); } if (guess.size() == 1) { letters.erase(guess.back()); } } return guess; }

Compilation message (stderr)

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