Submission #471568

#TimeUsernameProblemLanguageResultExecution timeMemory
471568Cross_RatioCombo (IOI18_combo)C++14
0 / 100
0 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; //int press(string); string guess_sequence(int N) { int isA = press("A"); int isB = press("B"); int isC = press("C"); int isD = press("D"); string st; if(isA) st = "A"; if(isB) st = "B"; if(isC) st = "C"; if(isD) st = "D"; while(st.length() < N) { string s1 = st + "A"; string s2 = st + "B"; string s3 = st + "C"; string s4 = st + "D"; if(press(s1) == s1.length()) st = s1; if(press(s2) == s2.length()) st = s2; if(press(s3) == s3.length()) st = s3; if(press(s4) == s4.length()) st = s4; } return st; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:18:23: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |     while(st.length() < N) {
      |           ~~~~~~~~~~~~^~~
combo.cpp:23:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         if(press(s1) == s1.length()) st = s1;
      |            ~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:24:22: 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(press(s2) == s2.length()) st = s2;
      |            ~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:25:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |         if(press(s3) == s3.length()) st = s3;
      |            ~~~~~~~~~~^~~~~~~~~~~~~~
combo.cpp:26:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |         if(press(s4) == s4.length()) st = s4;
      |            ~~~~~~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...