Submission #90816

#TimeUsernameProblemLanguageResultExecution timeMemory
90816tpoppoCombo (IOI18_combo)C++14
5 / 100
2 ms200 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; int n; string pref; vector<string> valid ={"A","B","X","Y"}; void get_next(){ string t1 = pref + valid[1]; for(int i=0;i<3;i++) t1 += pref + valid[2] + valid[i]; pref += valid[press(t1) - (int) pref.size()]; } void last(){ 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-1;i++) get_next(); last(); return pref; }

Compilation message (stderr)

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