제출 #513915

#제출 시각아이디문제언어결과실행 시간메모리
513915thegrimbee콤보 (IOI18_combo)C++14
5 / 100
1 ms256 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string ans = "", s = ""; int temp; if (press("AB")){ if (press("A"))ans = "A"; else ans = "B"; } else{ if (press("X"))ans = "X"; else ans = "Y"; } for (auto x : "ABXY"){ if (x != ans[0])s += x; } for (int i = 1; i < N-1; ++i){ temp = press(ans + s[0] + ans + s[1] + s[0] + ans + s[1] + s[1] + ans + s[1] + s[2]); if (temp == i + 1){ ans = ans + s[0]; } else if (temp == i + 2){ ans = ans + s[1]; } else ans = ans + s[2]; } if (press(ans + s[0] + ans + s[1]) == N){ if (press(ans + s[0]) == N)ans = ans + s[0]; else ans = ans + s[1]; } else ans = ans + s[2]; return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...