제출 #116186

#제출 시각아이디문제언어결과실행 시간메모리
116186mirbek01콤보 (IOI18_combo)C++11
10 / 100
101 ms440 KiB
# include <bits/stdc++.h> # include "combo.h" using namespace std; string t = "ABXY"; string guess_sequence(int N) { string ans; int ret = press("A"); if(ret) ans = "A"; ret = press("B"); if(ret) ans = "B"; ret = press("X"); if(ret) ans = "X"; ret = press("Y"); if(ret) ans = "Y"; for(int i = 1; i < N; i ++){ for(int j = 0; j < 4; j ++){ if(t[j] == ans[0]) continue; ans += t[j]; ret = press(ans); if(ret != ans.size()){ ans.pop_back(); } else { break; } } } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:30:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |                   if(ret != ans.size()){
      |                      ~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...