Submission #928600

#TimeUsernameProblemLanguageResultExecution timeMemory
928600AtabayRajabliCombo (IOI18_combo)C++17
0 / 100
2 ms696 KiB
#include <bits/stdc++.h> #include "combo.h" std::string guess_sequence(int N) { std::string s = ""; std::string l = "ABXY"; for(int i = 0; i < 4; i++) { s += l[i]; if(press(s))break; s.pop_back(); } l.erase(s[0]); for(int i = 2; i <= N; i++) { for(int j = 0; j < 3; j++) { std::string c = s; while(c.size() < N)c += l[j]; if(press(c) > s.size()) { s += l[j]; break; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:21:28: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   21 |             while(c.size() < N)c += l[j];
      |                   ~~~~~~~~~^~~
combo.cpp:22:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |             if(press(c) > s.size())
      |                ~~~~~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...