Submission #425340

#TimeUsernameProblemLanguageResultExecution timeMemory
425340dariascCombo (IOI18_combo)C++14
10 / 100
91 ms552 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; char chars[] = {'A', 'B', 'X', 'Y'}; string guess_sequence(int N) { string S = ""; for (auto btn : chars) { if (press(string(1, btn)) == 1) { S += btn; break; } } while (S.size() < N) { for (auto btn : chars) { if (btn != S[0]) { string cpy = S; cpy += btn; if (press(cpy) > S.size()) { S += btn; break; } } } } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:19: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   16 |   while (S.size() < N) {
      |          ~~~~~~~~~^~~
combo.cpp:21:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |         if (press(cpy) > S.size()) {
      |             ~~~~~~~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...