Submission #471571

#TimeUsernameProblemLanguageResultExecution timeMemory
471571Cross_RatioCombo (IOI18_combo)C++14
30 / 100
64 ms600 KiB
#include <bits/stdc++.h> //#include "combo.h" using namespace std; int press(string); string guess_sequence(int N) { int isA = press("AB"); int isC = press("XY"); string st; if(isA) { int isB = press("B"); if(isB) st = "B"; else st = "A"; } if(isC) { int isD = press("X"); if(isD) st = "X"; else st = "Y"; } while(st.length() < N) { string s1 = st + "A" + st + "B"; string s2 = st + "C" + st + "D"; if(press(s1) == st.length() + 1) { if(press(st + "A") == st.length() + 1) { st = st + "A"; } else st = st + "B"; } else { if(press(st + "X") == st.length() + 1) { st = st + "X"; } else st = st + "Y"; } } return st; }

Compilation message (stderr)

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