Submission #1088165

#TimeUsernameProblemLanguageResultExecution timeMemory
1088165MahmytMCombo (IOI18_combo)C++17
0 / 100
0 ms344 KiB
#include<bits/stdc++.h> #include<combo.h> using namespace std; string guess_sequence(int n){ string s=""; if(press("A")==1){ s+='A'; goto pl; } if(press("B")==1){ s+='A'; goto pl; } if(press("X")==1){ s+='A'; goto pl; } s+='Y'; pl:; for(int i=2;i<=n;i++){ if('A'==s[0]){ if(press(s+'B')==s.size()+1){ s+='B'; continue; } if(press(s+'X')==s.size()+1){ s+='X'; continue; } s+='Y'; continue; }else if('B'==s[0]){ if(press(s+'A')==s.size()+1){ s+='A'; continue; } if(press(s+'X')==s.size()+1){ s+='X'; continue; } s+='Y'; continue; }else if('X'==s[0]){ if(press(s+'A')==s.size()+1){ s+='A'; continue; } if(press(s+'B')==s.size()+1){ s+='B'; continue; } s+='Y'; continue; }else if('Y'==s[0]){ if(press(s+'A')==s.size()+1){ s+='A'; continue; } if(press(s+'B')==s.size()+1){ s+='B'; continue; } s+='X'; continue; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:19: 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+'B')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:27:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |    if(press(s+'X')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:34:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |    if(press(s+'A')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:38:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |    if(press(s+'X')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:45:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |    if(press(s+'A')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:49:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |    if(press(s+'B')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:56:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   56 |    if(press(s+'A')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:60:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |    if(press(s+'B')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...