Submission #303735

#TimeUsernameProblemLanguageResultExecution timeMemory
303735Gilgamesh콤보 (IOI18_combo)C++17
10 / 100
88 ms528 KiB
#include "combo.h"

std::string guess_sequence(int N) {
    std::string strs[4] = {"A", "B", "X", "Y"};
    std::string ans = "";
    while(N--){
        for(int i = 0; i < 4; ++i){
            int cur = press(ans + strs[i]);
            if(cur == ans.length() + 1) {
                ans += strs[i];
                break;
            }
        }
    }
    return ans;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:20: 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(cur == ans.length() + 1) {
      |                ~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...