Kth Largest
来源:互联网 发布:iphone7还原网络设置 编辑:程序博客网 时间:2024/06/03 05:49
Kth Largest
Totalsubmit: 970 Accepted: 168
Description
There are two sequences A and B with N (1<=N<=10000) elements each. All of the elements are positive integers. Given C=A*B, where '*' representing Cartesian product, c = a*b, where c belonging to C, a belonging to A and b belonging to B. Your job is to find the K'th largest element in C, where K begins with 1.
Input
Input file contains multiple test cases. The first line is the number of test cases. There are three lines in each test case. The first line of each case contains two integers N and K, then the second line represents elements in A and the following line represents elements in B. All integers are positive and no more than 10000. K may be more than 10000.
Output
For each case output the K'th largest number.
Sample Input
2
2 1
3 4
5 6
2 3
2 1
4 8
Sample Output
24
8
二分套二分,详细思路见注释
- Kth Largest
- Kth Largest
- Lintcode - kth largest element
- #5 Kth Largest Element
- **[Lintcode]Kth Largest Element
- LeetCode215. Kth largest element
- Kth largest numbers ii
- Kth Largest Element II
- hrbeu Kth Largest (二重二分)
- Kth Largest Element 解题报告
- LintCode 5: Kth Largest Element
- find kth largest number in an array
- Kth Largest Element in an Array
- Leetcode Kth Largest Element in an Array
- Kth Largest Element in an Array
- Kth Largest Element in an Array
- Leetcode: Kth Largest Element in an Array
- LeetCode Kth Largest Element in an Array
- NVelocity与asp:datalist整合
- 程序员的一天----时间、事件、感觉
- WINCE下实现基于USB的camera
- web强大功能的打印
- android模拟器相关
- Kth Largest
- 《让oracle跑得更快 》学习笔记02
- OnEraseBkGnd()函数
- 在网上看到一个活动很好,分享给大家
- 关于Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的问题
- javascript压缩工具使用说明-ECMAScript cruncher
- 庆祝Broncho的A301正式发布
- ASP.NET验证控件客户端验证成功或失败之后执行js脚本(转)
- VC中的一些常用方法(20条