Submission #624877

#TimeUsernameProblemLanguageResultExecution timeMemory
624877chubyxdxdCombo (IOI18_combo)C++11
30 / 100
47 ms552 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { string S= ""; if(press("A")==1)S+='A'; else{ if(press("B")==1)S+='B'; else{ if(press("X")==1)S+='X'; else S+='Y'; } } string g="ABXY"; string aux; for(int i=0;i<g.size();i++){ if(S[0]!=g[i])aux+=g[i]; } for(int i=1;i<N;i++){ if(press(S+aux[0])>S.size())S+=aux[0]; else{ if(press(S+aux[1])>S.size())S+=aux[1]; else S+=aux[2]; } } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |   for(int i=0;i<g.size();i++){
      |               ~^~~~~~~~~
combo.cpp:21:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     if(press(S+aux[0])>S.size())S+=aux[0];
      |        ~~~~~~~~~~~~~~~^~~~~~~~~
combo.cpp:23:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |       if(press(S+aux[1])>S.size())S+=aux[1];
      |          ~~~~~~~~~~~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...