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

建议使用的浏览器:

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

5188:zhx and contest

题目描述
As one of the most powerful brushes in the world, zhx usually takes part in all kinds of contests.
One day, zhx takes part in an contest. He found the contest very easy for him.
There are $n$ problems in the contest. He knows that he can solve the $i^{th}$ problem in $t_i$ units of time and he can get $v_i$ points.
As he is too powerful, the administrator is watching him. If he finishes the $i^{th}$ problem before time $l_i$, he will be considered to cheat.
zhx doesn't really want to solve all these boring problems. He only wants to get no less than $w$ points. You are supposed to tell him the minimal time he needs to spend while not being considered to cheat, or he is not able to get enough points.
Note that zhx can solve only one problem at the same time. And if he starts, he would keep working on it until it is solved. And then he submits his code in no time.
输入解释
Multiply test cases(less than $50$). Seek $EOF$ as the end of the file.
For each test, there are two integers $n$ and $w$ separated by a space. ($1 \leq n \leq 30$, $0 \leq w \leq {10}^{9}$)
Then come n lines which contain three integers $t_i, v_i, l_i$. ($1 \leq t_i,l_i \leq {10}^{5}, 1 \leq v_i \leq {10}^{9}$)
输出解释
For each test case, output a single line indicating the answer. If zhx is able to get enough points, output the minimal time it takes. Otherwise, output a single line saying "zhx is naive!" (Do not output quotation marks).
输入样例
1 3
1 4 7
3 6
4 1 8
6 8 10
1 5 2
2 7
10 4 1
10 2 3
输出样例
7
8
zhx is naive!
来自杭电HDUOJ的附加信息
Recommend hujie

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

题目来源 BestCoder Round #33

源链接: HDU-5188

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

共提交 0

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