Submission #90810

#TimeUsernameProblemLanguageResultExecution timeMemory
90810tpoppoCombo (IOI18_combo)C++14
30 / 100
66 ms456 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; int n; string pref; vector<char> valid ={'A','B','X','Y'}; void get_next(){ random_shuffle(valid.begin(),valid.end()); if(press(pref + valid[0] + pref + valid[1]) == pref.size()+1){ if(press(pref + valid[0]) == pref.size()+1){ pref += valid[0]; }else{ pref += valid[1]; } }else{ pref += valid[2]; } } string guess_sequence(int N) { n = N; if(press("AB")){ if(press("A")){ pref = "A"; valid.erase(valid.begin()); }else{ pref = "B"; valid.erase(valid.begin()+1); } }else{ if(press("X")){ pref = "X"; valid.erase(valid.begin()+2); }else{ pref = "Y"; valid.erase(valid.begin()+3); } } for(int i=1;i<n;i++) get_next(); return pref; }

Compilation message (stderr)

combo.cpp: In function 'void get_next()':
combo.cpp:13:49: 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(pref + valid[0] + pref + valid[1]) == pref.size()+1){
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
combo.cpp:14:35: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |         if(press(pref + valid[0]) == pref.size()+1){
      |            ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...