Intel Code Challenge Final Round D Dense Subsequence(线段树)
来源:互联网 发布:kpmg 大数据招聘 编辑:程序博客网 时间:2024/05/18 04:15
传送门:Dense Subsequence
题意:给定一个数k和一个字符串s,从s中选取一些字符形成新串,要求每k个连续字符至少要选1个,输出字典序最小的新串,aabb>aaabb,aabb>aab。
思路:遍历一遍,如果当前k个中没有选过,就把当前k个中的最小的选上。。(用线段树维护一下最小值)。。因为aabb>aaabb。。预处理字符串s中每个字母的出现次数。。把选上的字母进行排序,把字符串s中出现的小于选上的最大的字母的字母都输出,再输出最大的那些。。
this is code
3 0
- Intel Code Challenge Final Round D Dense Subsequence(线段树)
- Codeforces Round Intel Code Challenge Final Round D. Dense Subsequence
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) -- D. Dense Subsequence (技巧枚举)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) D. Dense Subsequence
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) D. Dense Subsequence 贪心 + RMQ
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) D. Dense Subsequence ST表+贪心
- Intel Code Challenge Final Round D 贪心
- Intel Code Challenge Elimination Round D Generating Sets(贪心+线段树)
- Intel Code Challenge Final Round B 暴力
- Intel Code Challenge Elimination Round D set
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)【A,B,C,D】
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) D题
- Intel Code Challenge Elimination Round C Destroying Array(线段树)
- Codeforces Round Intel Code Challenge Final Round B.Batch Sort
- Codeforces Round Intel Code Challenge Final Round C. Ray Tracing
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- Codeforces Intel Code Challenge Final Round C.Ray Tracing
- Qt 并行框架参考资料和视频
- 【leetcode】123. Best Time to Buy and Sell Stock III
- springMVC----springMVC的HelloWorld
- CSS几个单词的意思
- (笔记)Spring实战_面向切面的Spring(1)_什么是面向切面编程
- Intel Code Challenge Final Round D Dense Subsequence(线段树)
- 银行家算法之安全性算法
- leetcode: 198. House Robber dp
- spring-reference-The IoC container的翻译笔记(自己用)
- 关于ListView的transcriptMode属性
- 文件载入。带盘符的绝对路径 与 './file.php' '../file.php' 'file.php'
- centos开放端口以及Telnet测试端口
- 237. Delete Node in a Linked List
- LeetCode 112. Path Sum 题解