Submission #759132

#TimeUsernameProblemLanguageResultExecution timeMemory
759132ivazivaCombo (IOI18_combo)C++14
30 / 100
41 ms456 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; long long n; string guess_sequence(int N) { n=N; char pocetno_slovo=' '; string s; if (press("X")==1) pocetno_slovo='X'; else if (press("Y")==1) pocetno_slovo='Y'; else if (press("A")==1) pocetno_slovo='A'; else pocetno_slovo='B'; s.push_back(pocetno_slovo); for (long long i=2;i<=n;i++) { if (pocetno_slovo=='X') { if (press(s+'Y')==s.size()+1) s.push_back('Y'); else if (press(s+'A')==s.size()+1) s.push_back('A'); else s.push_back('B'); } if (pocetno_slovo=='Y') { if (press(s+'X')==s.size()+1) s.push_back('X'); else if (press(s+'A')==s.size()+1) s.push_back('A'); else s.push_back('B'); } if (pocetno_slovo=='A') { if (press(s+'X')==s.size()+1) s.push_back('X'); else if (press(s+'Y')==s.size()+1) s.push_back('Y'); else s.push_back('B'); } if (pocetno_slovo=='B') { if (press(s+'X')==s.size()+1) s.push_back('X'); else if (press(s+'Y')==s.size()+1) s.push_back('Y'); else s.push_back('A'); } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:22:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |             if (press(s+'Y')==s.size()+1) s.push_back('Y');
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:23:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |             else if (press(s+'A')==s.size()+1) s.push_back('A');
      |                      ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:28:29: 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(s+'X')==s.size()+1) s.push_back('X');
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:29:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |             else if (press(s+'A')==s.size()+1) s.push_back('A');
      |                      ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:34:29: 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+'X')==s.size()+1) s.push_back('X');
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:35:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |             else if (press(s+'Y')==s.size()+1) s.push_back('Y');
      |                      ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:40:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |             if (press(s+'X')==s.size()+1) s.push_back('X');
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:41:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   41 |             else if (press(s+'Y')==s.size()+1) s.push_back('Y');
      |                      ~~~~~~~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...