====== LCS Making ====== ===== 풀이 ===== * 주어진 문자열과 LCS가 특정 길이가 되는 문자열의 존재 여부를 찾는 문제. 간단한 방법으로 O(n)에 처리 가능하다 * [[ps:tutorial:lcs#주어진 S와의 LCS의 길이가 최소가 되는 수열 찾기]] 참고. ===== 코드 ===== """Solution code for "BOJ 33995. LCS Making". - Problem link: https://www.acmicpc.net/problem/33995 - Solution link: http://www.teferi.net/ps/problems/boj/33995 Tags: [lcs] """ import collections def main(): N, K = [int(x) for x in input().split()] S = input() counter = collections.Counter(S) print('1' if len(counter) < 26 or K >= min(counter.values()) else '0') if __name__ == '__main__': main() {{tag>BOJ ps:problems:boj:골드_2}}