제출 #303660

#제출 시각아이디문제언어결과실행 시간메모리
303660rocks03콤보 (IOI18_combo)C++14
97 / 100
44 ms716 KiB
#include <bits/stdc++.h> using namespace std; string c[] = {"A", "B", "X", "Y"}; int press(string); string guess_sequence(int N){ string s = ""; int ans = 0; for(int i = 0; i < 3; i++){ ans = press(c[i]); if(ans == 1){ s = c[i]; swap(c[i], c[3]); break; } } if(ans == 0){ s = c[3]; } for(int i = 1; i < N; i++){ if(i == N-1){ if(press(s + c[0]) == N){ s += c[0]; break; } if(press(s + c[1]) == N){ s += c[1]; break; } s += c[2]; break; } string toask = (s + c[0] + c[0]) + (s + c[0] + c[1]) + (s + c[0] + c[2]) + (s + c[1]); int cur = press(toask); if(cur == i + 2){ s += c[0]; } else if(cur == i + 1){ s += c[1]; } else if(cur == i){ s += c[2]; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...