제출 #1090935

#제출 시각아이디문제언어결과실행 시간메모리
1090935T0p_콤보 (IOI18_combo)C++14
100 / 100
27 ms1652 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int n) { string ans = ""; if (press("AB")) { ans += press("A") ? "A" : "B"; } else { ans += press("X") ? "X" : "Y"; } if (n == 1) { return ans; } vector<char> v; if (ans[0] != 'A') v.push_back('A'); if (ans[0] != 'B') v.push_back('B'); if (ans[0] != 'X') v.push_back('X'); if (ans[0] != 'Y') v.push_back('Y'); for (int i=1 ; i<n-1 ; i++) { string tmp = ""; for (char c : v) { tmp += ans + v[0] + c; } tmp += ans + v[1]; ans += v[i - press(tmp) + 2]; } if (press(ans + v[0]) == n) { return ans + v[0]; } else if (press(ans + v[1]) == n) { return ans + v[1]; } else { return ans + v[2]; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...