Submission #863062

#TimeUsernameProblemLanguageResultExecution timeMemory
863062maks007Combo (IOI18_combo)C++14
30 / 100
19 ms1716 KiB
#include "combo.h" #include "bits/stdc++.h" //#include "grader.cpp" using namespace std; string guess_sequence(int n) { string str = "", abxy; str += 'A'; if(press(str) == 1) goto end; str.pop_back(); str += 'B'; if(press(str) == 1) goto end; str.pop_back(); str += 'X'; if(press(str) == 1) goto end; str.pop_back(); str += 'Y'; end:; if(str.size() == n) return str; if(str[0] == 'X') abxy = "ABY"; else if(str[0] == 'A') abxy = "BXY"; else if(str[0] == 'Y') abxy = "ABX"; else abxy = "AXY"; while(1) { for(int i = 0; i < abxy.size() - 1; i ++) { str += abxy[i]; if(press(str) == str.size()) goto end2; str.pop_back(); } str += abxy.back(); end2:; if(str.size() == n) return str; } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:16: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |  if(str.size() == n) return str;
      |     ~~~~~~~~~~~^~~~
combo.cpp:26:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |   for(int i = 0; i < abxy.size() - 1; i ++) {
      |                  ~~^~~~~~~~~~~~~~~~~
combo.cpp:28:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |    if(press(str) == str.size()) goto end2;
      |       ~~~~~~~~~~~^~~~~~~~~~~~~
combo.cpp:33:17: 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(str.size() == n) return str;
      |      ~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...