Submission #269974

#TimeUsernameProblemLanguageResultExecution timeMemory
269974barsboldCombo (IOI18_combo)C++14
0 / 100
1 ms200 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'; int coins = press(s); if(coins == s.size()){ p+='A'; continue; } s = p + 'B'; coins = press(s); if(coins == s.size()){ p+='B'; continue; } s = p + 'X'; coins = press(s); if(coins == s.size()){ p +='X'; continue; } s = p + 'Y'; coins == press(s); if(coins == s.size()){ p += 'Y'; continue; } } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   if(coins == s.size()){
      |      ~~~~~~^~~~~~~~~~~
combo.cpp:18:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |   if(coins == s.size()){
      |      ~~~~~~^~~~~~~~~~~
combo.cpp:24:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   if(coins == s.size()){
      |      ~~~~~~^~~~~~~~~~~
combo.cpp:29:9: warning: value computed is not used [-Wunused-value]
   29 |   coins == press(s);
      |   ~~~~~~^~~~~~~~~~~
combo.cpp:30:12: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |   if(coins == s.size()){
      |      ~~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...