제출 #521626

#제출 시각아이디문제언어결과실행 시간메모리
521626tkwiatkowski콤보 (IOI18_combo)C++17
100 / 100
31 ms620 KiB
/* Zadanie: Combo Autor: Tomasz Kwiatkowski */ #include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { char c[4] = {'A', 'B', 'X', 'Y'}; if (press("AB")) { if (press("B")) swap(c[0], c[1]); } else { if (press("X")) swap(c[0], c[2]); else swap(c[0], c[3]); } string pref; pref += c[0]; if (N == 1) return pref; for (int i = 1; i < N-1; ++i) { int k = press(pref + c[1] + pref + c[2] + c[1] + pref + c[2] + c[2] + pref + c[2] + c[3]); if (k == i) pref += c[3]; else if (k == i + 1) pref += c[1]; else pref += c[2]; } if (press(pref + c[1]) == N) return pref + c[1]; if (press(pref + c[2]) == N) return pref + c[2]; return pref + c[3]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...