제출 #75003

#제출 시각아이디문제언어결과실행 시간메모리
75003TAMREF콤보 (IOI18_combo)C++17
100 / 100
60 ms588 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; const char itc[5] = "ABXY"; char l[3]; int cti[256]; int bani; string guess_sequence(int N){ cti['A'] = 0; cti['B'] = 1; cti['X'] = 2; cti['Y'] = 3; string p1 = "AB"; if(press(p1)){ string p2 = "A"; if(press(p2)) bani = 0; else bani = 1; }else{ string p2 = "X"; if(press(p2)) bani = 2; else bani = 3; } for(int i = 0, x = 0; i < 4; i++){ if(i == bani) continue; l[x++] = itc[i]; } string S = ""; S += itc[bani]; if(N == 1) return S; for(int i = 1; i <= N-2; i++){ string p = ""; p += S; p += l[0]; p += l[0]; p += S; p += l[0]; p += l[1]; p += S; p += l[0]; p += l[2]; p += S; p += l[1]; int C = press(p) - S.size(); S += l[2-C]; } string p = ""; p += S; p += l[0]; p += S; p += l[1]; if(press(p) < N){ S += l[2]; return S; }else{ p = ""; p += S; p += l[0]; if(press(p) < N){ S += l[1]; return S; } S += l[0]; return S; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...