Submission #210579

#TimeUsernameProblemLanguageResultExecution timeMemory
210579grobarCombo (IOI18_combo)C++14
0 / 100
55 ms284 KiB
#include <combo.h> using namespace std; string guess_sequence(int n) { string ss=""; int a1=press("A"); if(a1==1) { ss=ss+"A"; for(int i=1;i<n;i++) { if(press(ss+"B")==i+1) { ss=ss+"B"; if(ss.size()==n) { break; } } if(press(ss+"X")==i+1) { ss=ss+"X"; if(ss.size()==n) { break; } } if(press(ss+"Y")==i+1) { ss=ss+"Y"; if(ss.size()==n) { break; } } } } int a2=press("B"); if(a2==1) { ss=ss+"B"; for(int i=1;i<n;i++) { if(press(ss+"A")==i+1) { ss=ss+"A"; if(ss.size()==n) { break; } } if(press(ss+"X")==i+1) { ss=ss+"X"; if(ss.size()==n) { break; } } if(press(ss+"Y")==i+1) { ss=ss+"Y"; if(ss.size()==n) { break; } } } } int a3=press("X"); if(a3==1) { ss=ss+"X"; for(int i=1;i<n;i++) { if(press(ss+"A")==i+1) { ss=ss+"A"; if(ss.size()==n) { break; } } if(press(ss+"B")==i+1) { ss=ss+"B"; if(ss.size()==n) { break; } } if(press(ss+"Y")==i+1) { ss=ss+"Y"; if(ss.size()==n) { break; } } } } int a4=press("Y"); if(a4==1) { ss=ss+"Y"; for(int i=1;i<n;i++) { if(press(ss+"A")==i+1) { ss=ss+"A"; if(ss.size()==n) { break; } } if(press(ss+"X")==i+1) { ss=ss+"X"; if(ss.size()==n) { break; } } if(press(ss+"B")==i+1) { ss=ss+"B"; if(ss.size()==n) { break; } } } } return ss; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   17 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:25:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   25 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:33:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   33 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:49:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   49 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:57:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   57 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:65:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   65 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:81:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   81 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:89:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   89 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:97:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   97 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:113:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  113 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:121:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  121 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
combo.cpp:129:29: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  129 |                 if(ss.size()==n)
      |                    ~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...