Submission #1085028

#TimeUsernameProblemLanguageResultExecution timeMemory
1085028StaheosCombo (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; }

Compilation message (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...