Submission #736969

#TimeUsernameProblemLanguageResultExecution timeMemory
736969almothana05Combo (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include "combo.h" #include "bits/stdc++.h" using namespace std; string guess_sequence(int menge) { string s , t = "" , cmp = ""; int x = press("AB"); if(x == 0){ x = press("X"); if(x == 0){ s += 'Y'; t = "ABX"; } else{ s += 'X'; t = "ABY"; } } else{ x = press("A"); if(x == 0){ s += 'B'; t = "AYX"; } else{ s += 'A'; t = "YBX"; } } for(int i = 1 ; i < menge - 1 ; i++){ cmp += s; cmp += t[0]; cmp += s; cmp += t[1]; cmp += t[0]; cmp += s; cmp += t[1]; cmp += t[1]; cmp += s; cmp += t[1]; cmp += t[2]; x = press(cmp); if(x == s.size()){ s += t[2]; } else if(x == s.size() + 1){ s += t[0]; } else{ s += t[1]; } cmp = ""; } cmp += s; cmp += t[0]; cmp += s; cmp += t[1]; x = press(cmp); if(x == s.size()){ s += t[2]; } else{ cmp = s; cmp += t[0]; x = press(cmp); if(x == s.size()){ s += t[1]; } else{ s += t[0]; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:46:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |     if(x == s.size()){
      |        ~~^~~~~~~~~~~
combo.cpp:49:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |     else if(x == s.size() + 1){
      |             ~~^~~~~~~~~~~~~~~
combo.cpp:64:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   64 |   if(x == s.size()){
      |      ~~^~~~~~~~~~~
combo.cpp:71:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   71 |     if(x == s.size()){
      |        ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...