제출 #116203

#제출 시각아이디문제언어결과실행 시간메모리
116203mirbek01콤보 (IOI18_combo)C++11
100 / 100
44 ms548 KiB
# include <bits/stdc++.h> # include "combo.h" using namespace std; char a, b, c; string guess_sequence(int N) { string ans; if(press("AB")){ if(press("A")) ans = "A", a = 'B', b = 'X', c = 'Y'; else ans = "B", a = 'A', b = 'X', c = 'Y'; } else { if(press("X")) ans = "X", a = 'A', b = 'B', c = 'Y'; else ans = "Y", a = 'A', b = 'B', c = 'X'; } int now = 1; for(int i = 1; i < N - 1; i ++){ int ret = press(ans + a + a + ans + a + b + ans + a + c + ans + b); if(ret == 0 + now) ans += c; if(ret == 1 + now) ans += b; if(ret == 2 + now) ans += a; now ++; } if(N > 1){ if(press(ans + a + ans + b) == N){ if(press(ans + a) == N) ans += a; else ans += b; } else ans += c; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...