Submission #759150

#TimeUsernameProblemLanguageResultExecution timeMemory
759150ivazivaCombo (IOI18_combo)C++14
0 / 100
1 ms208 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); ///testovi za 30p for (long long i=2;i<=n;i++) { if (pocetno_slovo=='X') { long long rez=press(s+'Y'+s+"AA"+s+"AY"+s+"AB"); if (rez==s.size()) s.push_back('B'); else if (rez==s.size()+1) s.push_back('Y'); else s.push_back('A'); } if (pocetno_slovo=='Y') { long long rez=press(s+'X'+s+"AX"+s+"AA"+s+"AB"); if (rez==s.size()) s.push_back('B'); else if (rez==s.size()+1) s.push_back('X'); else s.push_back('A'); } if (pocetno_slovo=='A') { long long rez=press(s+'X'+s+"YX"+s+"YY"+s+"YB"); if (rez==s.size()) s.push_back('B'); else if (rez==s.size()+1) s.push_back('X'); else s.push_back('Y'); } if (pocetno_slovo=='B') { long long rez=press(s+'X'+s+"YX"+s+"YY"+s+"YA"); if (rez==s.size()) s.push_back('A'); else if (rez==s.size()+1) s.push_back('X'); else s.push_back('Y'); } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:24:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |             if (rez==s.size()) s.push_back('B');
      |                 ~~~^~~~~~~~~~
combo.cpp:25:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |             else if (rez==s.size()+1) s.push_back('Y');
      |                      ~~~^~~~~~~~~~~~
combo.cpp:31:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |             if (rez==s.size()) s.push_back('B');
      |                 ~~~^~~~~~~~~~
combo.cpp:32:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |             else if (rez==s.size()+1) s.push_back('X');
      |                      ~~~^~~~~~~~~~~~
combo.cpp:38:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |             if (rez==s.size()) s.push_back('B');
      |                 ~~~^~~~~~~~~~
combo.cpp:39:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |             else if (rez==s.size()+1) s.push_back('X');
      |                      ~~~^~~~~~~~~~~~
combo.cpp:45:20: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |             if (rez==s.size()) s.push_back('A');
      |                 ~~~^~~~~~~~~~
combo.cpp:46:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |             else if (rez==s.size()+1) s.push_back('X');
      |                      ~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...