제출 #625184

#제출 시각아이디문제언어결과실행 시간메모리
625184Mr_Husanboy콤보 (IOI18_combo)C++14
100 / 100
38 ms576 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { int n = N; vector<string> let = {"A", "B", "X", "Y"}; string ans = ""; if(press("AB")){ if(press("A")) ans = "A"; else ans = "B"; }else{ if(press("X")) ans = "X"; else ans = "Y"; } let.erase(find(let.begin(), let.end(), ans)); for(int i = 1; i < n - 1; i ++){ int ask = press(ans + let[0] + ans + let[1] + let[0] + ans + let[1] + let[1] + ans + let[1] + let[2]); if(ask == i){ ans += let[2]; }else if(ask == i + 1) ans += let[0]; else ans += let[1]; } if(n != 1){ if(press(ans + let[0]) == n){ ans += let[0]; }else if(press(ans + let[1]) == n) ans += let[1]; else ans += let[2]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...