제출 #928601

#제출 시각아이디문제언어결과실행 시간메모리
928601AtabayRajabli콤보 (IOI18_combo)C++17
10 / 100
37 ms1216 KiB
#include <bits/stdc++.h> #include "combo.h" std::string guess_sequence(int N) { std::string s = ""; std::string l = "ABXY"; for(int i = 0; i < 4; i++) { s += l[i]; if(press(s))break; s.pop_back(); } for(int i = 2; i <= N; i++) { for(int j = 0; j < 4; j++) { if(l[j] == s[0])continue; std::string c = s; while(c.size() < N)c += l[j]; if(press(c) > s.size()) { s += l[j]; break; } } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:21:28: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   21 |             while(c.size() < N)c += l[j];
      |                   ~~~~~~~~~^~~
combo.cpp:22:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |             if(press(c) > s.size())
      |                ~~~~~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...