CF1038A Equality

题目描述

### 题目大意: 给定一个长度为$n$的字符串和$k$,问这个字符串包含字母表前$k$个大写字母并且数量相同的子序列最长是多少

输入格式

第一行两个整数$n,k$ 第二行一个长度为$n$的字符串 第一行两个整数$n,k$ 第二行一个长度为$n$的字符串

输出格式

一个整数,表示最小长度 ``` ### 题目大意: 给定一个长度为$n$的字符串和$k$,问这个字符串包含字母表前$k$个大写字母并且数量相同的子序列最长是多少 一个整数,表示最小长度 ```

说明/提示

In the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length. In the second example, none of the subsequences can have 'D', hence the answer is $ 0 $ .