제출 #849483

#제출 시각아이디문제언어결과실행 시간메모리
849483Bach21콤보 (IOI18_combo)C++14
10 / 100
27 ms1456 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; const int m=4; string gue="ABXY"; string guess_sequence(int N) { string s=""; string tmp=""; int cnt=0; for (int i=0;i<N;i++) { for (int trie = 0; trie < gue.size(); trie++) { tmp = s; tmp += gue[trie]; cnt = press(tmp); if (cnt > s.size()) { s+=gue[trie]; if (i==0) gue.erase(gue.begin()+trie); break; } } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |         for (int trie = 0; trie < gue.size(); trie++) {
      |                            ~~~~~^~~~~~~~~~~~
combo.cpp:15:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |             if (cnt > s.size()) {
      |                 ~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...