제출 #256762

#제출 시각아이디문제언어결과실행 시간메모리
256762lani1akea콤보 (IOI18_combo)C++17
0 / 100
91 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string p = ""; vector<char> LET = {'A', 'B', 'X', 'Y'}; int x, y, st = 0; y = press({"AB"}); if (y >= 1) { st = y; p += (y == 2 ? "AB" : "A"); } else { y = press({"BX"}); if (y >= 1) { st = y; p += (y == 2 ? "BX" : "B"); } else { y = press({"XY"}); if (y >= 1) { st = y; p += (y == 2 ? "XY" : "X"); } else { st = 1; p += "Y"; } } } if (p[0] == 'A') LET.erase(LET.begin()); else if (p[0] == 'B') LET.erase(LET.begin() + 1); else if (p[0] == 'X') LET.erase(LET.begin() + 2); else LET.erase(LET.begin() + 3); for (int i = st; i < N; ++i) { while(true) { random_shuffle(LET.begin(), LET.end()); y = press(p + LET[0] + LET[1] + LET[2]); if (y >= i + 1) { if (y == i + 1) { p += LET[0]; } else if ( y == i + 2) { p += LET[0]; p += LET[1]; ++i; } else { p += LET[0]; p += LET[1]; p += LET[2]; i += 2; } break; } else continue; } } return p; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:7: warning: unused variable 'x' [-Wunused-variable]
    9 |   int x, y, st = 0;
      |       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...