제출 #1049193

#제출 시각아이디문제언어결과실행 시간메모리
1049193Jer콤보 (IOI18_combo)C++17
10 / 100
30 ms848 KiB
#include "combo.h" using namespace std; string guess_sequence(int n) { string letters = "ABXY", start, curr, trial; for (char x : letters) { start = x; if (press(start) == 1) { break; } } curr = start; while ((int)curr.size() < n) { bool found_next_char = false; for (char x : letters) { if (x == start[0]) continue; trial = curr + x; int res = press(trial); if (res == (int)curr.size() + 1) { curr += x; found_next_char = true; break; } } } return curr; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:21:14: warning: variable 'found_next_char' set but not used [-Wunused-but-set-variable]
   21 |         bool found_next_char = false;
      |              ^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...