Submission #751793

#TimeUsernameProblemLanguageResultExecution timeMemory
751793kusmetliqCombo (IOI18_combo)C++14
0 / 100
0 ms208 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int n) { string ans=""; string av="ABXY"; char special; if(press("A")==1)special='A'; else if(press("B")==1)special='B'; else if(press("X")==1)special='X'; else special='Y'; ans+=special; av.erase(find(av.begin(),av.end(),special)); cout<<av<<endl; for(int i=1;i<n;i++) { for(int j=0;j<av.size();j++) { if(j==av.size()-1)ans+=av[j]; else { ans+=av[j]; if(press(ans)==ans.size()){break;} else ans.pop_back(); } } } return ans; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for(int j=0;j<av.size();j++) {
      |                     ~^~~~~~~~~~
combo.cpp:17:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |             if(j==av.size()-1)ans+=av[j];
      |                ~^~~~~~~~~~~~~
combo.cpp:20:30: 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(ans)==ans.size()){break;}
      |                    ~~~~~~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...