当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5960:Subsequence

题目描述
You may notice the following program. It evaluates a kind of cost about given sequence.

For a sequence A consists of many triples ($cost_0, cost_1$, color), its each subsequence has a cost which calculated by this program. Alice wants to know the cost of the subsequence which is the one owns the k-th largest cost.
输入解释
The first line of input contains an integer t, the number of test cases. t test cases follow.
For each test case, the first line consists two integers, n the length of sequence and k. The i-th line in the following n line consists three non-negative integers $cost_0, cost_1$ and color, where 0 <= $cost_0, cost_1$ <= 10000 and 0 <=color <=1, corresponding to the i-th triple in the sequence.
We guarantee that the sequence has at least k non-empty subsequences.
The sum of all n is no more than 400000 and the sum of all k is no more than 400000.
输出解释
For each case, output the answer in one line.
输入样例
1
3 4
2 1 0
1 3 1
3 1 1
输出样例
3
提示
来自杭电HDUOJ的附加信息
Recommend jiangzijing2015

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5960

最后修改于 2020-10-25T23:27:05+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 131072/131072K(Java/Others)