Password
시간 제한3초메모리 제한1024 MB
비밀번호 길이 N, 알파벳 크기 S, 그리고 임의의 질의 문자열에 대해 반환되는 최장 접두사 부분수열 길이를 이용해 모든 응답과 일치하는 비밀번호 하나를 복원합니다.
문제
I forgot my password again! I am sitting at my computer punching in wrong passwords. All I remember is that my password contains only lowercase letters. Luckily, the login system responds with more than just "wrong password". It also tells me the length of the longest prefix of my input that occurs as a (not necessarily contiguous) subsequence in the password. Formally, for a password P=p1 p2 … pN and input Q=q1 q2 …qN, the login system’s answer is the largest L for which there exist indices 1≤ k1 < k2 < … < kL ≤ N such that qi = pki for all 1 ≤ i ≤ L. The system also tells me N, the length of my password, and S, meaning my password only uses the first S letters of the alphabet. For example, S = 4 means my password only contains a, b, c and d (but not necessarily all of them).
Please help me recover my password!
예제
이 문제는 공개된 예제가 없습니다.