제출 #705910

#제출 시각아이디문제언어결과실행 시간메모리
705910mseebacher콤보 (IOI18_combo)C++17
30 / 100
41 ms564 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int n) { string s = ""; vector<char> se = {'A','B','X','Y'}; if(press("A")){ s = "A"; }else if(press("B")){ s = "B"; }else if(press("X")){ s = "X"; }else{ s = "Y"; } se.erase(find(se.begin(),se.end(),s[0])); while(s.length() != n){ if(press(s+se[0]) == s.length()+1){ s+= se[0]; }else if(press(s+se[1]) == s.length()+1){ s+= se[1]; }else{ s+= se[2]; } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:18:20: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   18 |   while(s.length() != n){
      |         ~~~~~~~~~~~^~~~
combo.cpp:19:21: 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(s+se[0]) == s.length()+1){
      |      ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
combo.cpp:21:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |   }else if(press(s+se[1]) == s.length()+1){
      |            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...