제출 #751796

#제출 시각아이디문제언어결과실행 시간메모리
751796kusmetliq콤보 (IOI18_combo)C++14
30 / 100
55 ms444 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)); 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; }

컴파일 시 표준 에러 (stderr) 메시지

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