Submission #155580

#TimeUsernameProblemLanguageResultExecution timeMemory
155580bukanYohandiCombo (IOI18_combo)C++14
0 / 100
44 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" std::string guess_sequence(int N) { std::string S = ""; while(S.length()<=N){ if(press(S+'A')==S.length()+1){S+='A';continue;} if(press(S+'B')==S.length()+1){S+='B';continue;} if(press(S+'X')==S.length()+1){S+='X';continue;} if(press(S+'Y')==S.length()+1){S+='Y';continue;} } 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:7:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |    if(press(S+'A')==S.length()+1){S+='A';continue;}
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:8:19: 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+'B')==S.length()+1){S+='B';continue;}
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:9:19: 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+'X')==S.length()+1){S+='X';continue;}
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:10:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |    if(press(S+'Y')==S.length()+1){S+='Y';continue;}
      |       ~~~~~~~~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...