Submission #104383

#TimeUsernameProblemLanguageResultExecution timeMemory
104383dupreezCombo (IOI18_combo)C++14
30 / 100
72 ms444 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string cs = ""; for (; cs.size() < N;) { int v1 = press(cs + "A" + cs + "B"); if (v1 > cs.length()) { if (press(cs + "A") > cs.length())cs += "A"; else cs += "B"; } else { if (press(cs + "X") > cs.length())cs += "X"; else cs += "Y"; } } return cs; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:6:19: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    6 |  for (; cs.size() < N;) {
      |         ~~~~~~~~~~^~~
combo.cpp:8:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |   if (v1 > cs.length()) {
      |       ~~~^~~~~~~~~~~~~
combo.cpp:9:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |    if (press(cs + "A") > cs.length())cs += "A";
      |        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
combo.cpp:13:24: 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 (press(cs + "X") > cs.length())cs += "X";
      |        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...