Submission #155581

#TimeUsernameProblemLanguageResultExecution timeMemory
155581bukanYohandiCombo (IOI18_combo)C++14
10 / 100
109 ms548 KiB
#include <bits/stdc++.h> #include "combo.h" std::string guess_sequence(int N) { std::string S = ""; while(S.length()<N){ S.push_back('A'); if(press(S)==S.length()){continue;} S.pop_back(); S.push_back('B'); if(press(S)==S.length()){continue;} S.pop_back(); S.push_back('X'); if(press(S)==S.length()){continue;} S.pop_back(); S.push_back('Y'); if(press(S)==S.length()){continue;} S.pop_back(); } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:6:19: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    6 |   while(S.length()<N){
      |         ~~~~~~~~~~^~
combo.cpp:8:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |    if(press(S)==S.length()){continue;}
      |       ~~~~~~~~^~~~~~~~~~~~
combo.cpp:11:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |    if(press(S)==S.length()){continue;}
      |       ~~~~~~~~^~~~~~~~~~~~
combo.cpp:14:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |    if(press(S)==S.length()){continue;}
      |       ~~~~~~~~^~~~~~~~~~~~
combo.cpp:17:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |    if(press(S)==S.length()){continue;}
      |       ~~~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...