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

建议使用的浏览器:

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

5757:Product Bo

题目描述
Given $N$ real numbers $a_1,a_2,\ldots,a_N$. Consider a subsequence of $a$: $1 \leq s_1 < s_2 < \ldots < s_M \leq N$. Define $f(s) = \prod_{i=1}^{M} a_{s_i}$. Your task is to figure out the $K$-th largest value of $f(s)$ among all the $\binom{N}{M}$ subsequences of length $M$ (same values count multiple times).

It is known to all that multiplication of big numbers is troublesome. Therefore, we represent numbers in this format: first, a character '+', '-' or '0', indicating positive, negative, or zero respectively. If it's nonzero, then there follows a space and an integer in $[-10^9,+10^9]$, indicating the logarithm of the absolute value of this number to some fixed base which $\geq 1$.
输入解释
Multiple test cases. For each test case, the first line contains three integers $N,M,K$. Then follows $N$ lines, the $i$-th of which indicates $a_i$ in the format described above. The input ends with a line $0~0~0$. It is guaranteed that $1 \leq M \leq N, ~ 1 \leq K \leq \binom{N}{M}, ~ N,K \leq 2 \times 10^5$.
输出解释
For each test case print the answer in the format described above.
输入样例
3 2 2
+ 3
+ 7
- 2
3 2 2
+ -1
0
0
0 0 0
输出样例
- 5
0
来自杭电HDUOJ的附加信息
Author 绍兴一中
Recommend wange2014

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

源链接: HDU-5757

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

共提交 0

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