摘要: 求每一种字符出现次数的前缀和,然后二分答案的长度就可 阅读全文
posted @ 2020-05-17 22:20 CrosseaLL 阅读(256) 评论(0) 推荐(0) 编辑
摘要: Sample Input 5 4 1 2 3 4 5 5 1 3 1 Sample Output 3 思路,首先发现a[i]的值的范围是在1~n之间,每次插入我们可以直接把cnt[a[i]]++ 删除的时候,要把所有在后面的数往前挪一位,那么其实也相当于所有在后面的数的前面 的cnt的前缀和减去1, 阅读全文
posted @ 2020-05-17 21:44 CrosseaLL 阅读(310) 评论(0) 推荐(1) 编辑
摘要: 暴力完事 直接拆分排序组合 c++ class Solution { public: bool in(bool cnt[100][1001], int i, int j, int len){ for(int k=0; k peopleIndexes(vector & a) { bool cnt[10 阅读全文
posted @ 2020-05-17 14:46 CrosseaLL 阅读(195) 评论(0) 推荐(0) 编辑