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

建议使用的浏览器:

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

6335:Problem D. Nothing is Impossible

题目描述
$m$ students, including Kazari, will take an exam tomorrow.
The paper consists of exactly $n$ problems, the $i$-th problem contains $a_i$ correct answers and $b_i$ incorrect answers, i.e. the $i$-th problem contains $a_i + b_i$ candidates in total.
Each student should choose exactly one candidate as answer for each problem. If the answer to a certain problem is correct, then the student will get one point. The student who gets the most points wins.
Students only know the structure of the paper, but they are able to talk with each other during the exam. They decide to choose a subset $S$ of all $n$ problems, and they will only be able to submit answers on these problems.
They want to know the maximum size of $S$ that the winner among them will solve all the problems in $S$ if they take the optimal strategy.


For sample $1$, students can choose $S = \{1\}$,and we need at least $4$ students to guarantee the winner solve the only problem.

For sample $2$, students can choose $S = \{1, 2, 3\}$, and we need at least $24$ students to guarantee the winner solve these three problems, but if $|S| = 4$, we need at least $96$ students, which is more than $50$.
输入解释
The first line of the input contains an integer $T$ $(1 \le T \le 100)$ denoting the number of test cases.
Each test case starts with two integers $n, m$ $(1 \le n \le 100, 1 \le m \le 10 ^ 9)$, denoting the number of problems and the number of students. Each of next $n$ lines contains two integers $a_i, b_i$ ($1 \le b_i \le 100, a_i = 1$), indicating the number of correct answers and the number of incorrect answers of the $i$-th problem.
输出解释
For each test case, print an integer denoting the maximum size of $S$.
输入样例
2	
3 5
1 3
1 3
1 3
5 50
1 1
1 3
1 2
1 3
1 5
输出样例
1
3
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6335

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

共提交 0

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