제출 #1085028

#제출 시각아이디문제언어결과실행 시간메모리
1085028Staheos콤보 (IOI18_combo)C++14
10 / 100
63 ms856 KiB
#include <string> #include "combo.h" #include <iostream> using namespace std; string guess_sequence(int N) { int ab = press("AB"); int xy = press("XY"); char first; if (ab > 0) { if (press("A") > 0) { first = 'A'; } else { first = 'B'; } } else { if (press("X") > 0) { first = 'X'; } else { first = 'Y'; } } string p = ""; p += first; for (int i = 1; i < N; i++) { p = p + 'A'; int m = press(p); if (m > i) { continue; } p[i] = 'B'; m = press(p); if (m > i) { continue; } p[i] = 'X'; m = press(p); if (m > i) { continue; } p[i] = 'Y'; m = press(p); if (m > i) { continue; } } return p; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:6: warning: unused variable 'xy' [-Wunused-variable]
   10 |  int xy = press("XY");
      |      ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...