제출 #692247

#제출 시각아이디문제언어결과실행 시간메모리
692247maks007콤보 (IOI18_combo)C++14
10 / 100
66 ms552 KiB
#include "combo.h" #include "bits/stdc++.h" using namespace std; string alph = "ABXY"; std::string guess_sequence(int N) { string str; for(int i = 0; i < 4; i ++) { str += alph[i]; if(press(str) == 1) break; str.pop_back(); } while(str.size() != N) { for(int i = 0; i < 4; i ++) { if(alph[i] == str[0]) continue; str += alph[i]; if(press(str) == str.size()) break; str.pop_back(); } } return str; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:15:19: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   15 |  while(str.size() != N) {
      |        ~~~~~~~~~~~^~~~
combo.cpp:19:18: 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(str) == str.size()) break;
      |       ~~~~~~~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...