Submission #269891

#TimeUsernameProblemLanguageResultExecution timeMemory
269891barsboldCombo (IOI18_combo)C++14
0 / 100
3 ms456 KiB
#include "combo.h" #include <bits/stdc++.h> #define ff first #define ss second #define pb push_back std::string guess_sequence(int N) { std::string p = ""; std::string s = ""; for(int i = 0; i<N; i++){ s = p + 'A'; if(s[s.size() - 1] == 'A'){ int coins = press(s); if(coins == s.size()){ p+='A'; continue; } } s = p + "B"; if(s[s.size() - 1] == 'B'){ int coins = press(s); if(coins == s.size()){ p+='B'; continue; } } s = p +'X'; if(s[s.size() - 1] == 'X'){ int coins = press(s); if(coins == s.size()){ p+='X'; continue; } } s = p + 'Y'; if(s[s.size() - 1] == 'Y'){ int coins = press(s); if(coins == s.size()){ p+='Y'; continue; } } if(p.size() == N) return p; } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     if(coins == s.size()){
      |        ~~~~~~^~~~~~~~~~~
combo.cpp:21:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     if(coins == s.size()){
      |        ~~~~~~^~~~~~~~~~~
combo.cpp:29:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     if(coins == s.size()){
      |        ~~~~~~^~~~~~~~~~~
combo.cpp:37:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |     if(coins == s.size()){
      |        ~~~~~~^~~~~~~~~~~
combo.cpp:42:15: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   42 |   if(p.size() == N) return p;
      |      ~~~~~~~~~^~~~
combo.cpp:8:19: warning: control reaches end of non-void function [-Wreturn-type]
    8 |   std::string s = "";
      |                   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...