제출 #426134

#제출 시각아이디문제언어결과실행 시간메모리
426134hibye1217콤보 (IOI18_combo)C++17
100 / 100
55 ms560 KiB
#ifndef NOTSUBMIT #include "combo.h" #include <bits/stdc++.h> using namespace std; #endif string guess_sequence(int N) { string ans = ""; char c1='A', c2='B', c3='X'; if (press("AB") != 0){ if (press("A") != 0){ ans += "A"; c1='Y'; } else{ ans += "B"; c2='Y'; } } else{ if (press("X") != 0){ ans += "X"; c3='Y'; } else{ ans += "Y"; } } if (N == 1){ return ans; } for (int i = 2; i < N; i++){ int res = press(ans+c1+c1 + ans+c1+c2 + ans+c1+c3 + ans+c2); if (res >= i+1){ ans += c1; } else if (res == i){ ans += c2; } else{ ans += c3; } } if (press(ans+c1) == N){ return ans+c1; } else if (press(ans+c2) == N){ return ans+c2; } else{ return ans+c3; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...