Submission #730533

#TimeUsernameProblemLanguageResultExecution timeMemory
730533CutebolCombo (IOI18_combo)C++17
10 / 100
79 ms568 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std ; string guess_sequence( int n ) { string ans ; vector <char> vec = { 'A' , 'B' , 'X' , 'Y' } ; while ( ans.size() < n ){ for ( int i = 0 ; i < 4 ; i ++ ){ if ( press(ans+vec[i]) == ans.size()+1 ){ ans += vec[i] ; break ; } } } return ans ; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:7:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    7 |  while ( ans.size() < n ){
      |          ~~~~~~~~~~~^~~
combo.cpp:9:27: 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(ans+vec[i]) == ans.size()+1 ){
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...