Submission #867976

#TimeUsernameProblemLanguageResultExecution timeMemory
867976wiiCombo (IOI18_combo)C++17
10 / 100
38 ms1440 KiB
#include "combo.h"

std::string guess_sequence(int N) {
    std::string S;

    for (int i = 1; i <= N; ++i) {
        for (char c: {'A', 'B', 'X', 'Y'}) {
            S.push_back(c);
            if (press(S) == S.size())
                break;
            S.pop_back();
        }
    }

    return S;
}

Compilation message (stderr)

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