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

建议使用的浏览器:

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

6968:I love exam

题目描述
Student Z doesn't love exams

The exam was about to be done soon, but student Z didn't even read the book, He had collapsed.

Student Z has a total of $n$ exams, and there are still $t$ days before the start of the exam, which means he still has $t$ days to PREVIEW.

But student Z couldn’t even read the textbooks, and couldn’t review it at all. Fortunately, a kind classmate gave him $m$ sets of review materials. The $i$ set of materials can improve the grades of the $s_i$ course. The $i$ set of materials needs to be studied for $y_i$ days. You can increase $x_i$ points later (the upper limit of each course is $100$ points, so after it is upgraded to $100$ points, there will be no further increase).and note that each set of review materials can only be used once.

Student Z now has a zero-point level in every course. it is impossible to review all the materials, so he needs to choose some materials to review, but he can fail at most $p$ courses in this semester (if the score of one course is less than 60 points will fail), otherwise he will be talked to by the professor.

Student Z now wants to know the maximum points he can get in all courses under the premise of fail no more than $p$ courses this semester. If he cannot meet the conditions, please output $ -1 $ .
输入解释
A positive integer $T$ ($T \leq 10$) in the first line represents the number of test cases.

For each test case:

The first line contains a positive integer $n$ ($n \leq 50$) represents the total number of courses in this semester.

The second line contains $n$ strings which length is no more than $15$, representing the course name of each course in this semester.

The third line contains a positive integer $m$ ($m \leq 15000$) represents the number of review materials he obtained.

In the next m lines, each line have a string $s$ and two positive integers $x$($1 \leq x \leq 10$) and $y$($1 \leq y \leq 10$) , representing the course of this set of materials review, the improved scores and The number of days required for learning(data assurance this course was studied this semester ).

The last line has two integers $t$, $p$($1 \leq t \leq 500, 0 \leq p\leq 3$) represents the number of review days that student Z has and the upper limit of the number of failed courses in this semester.
输出解释
For each test case, output a line with a positive integer representing the maximum score that student Z can obtain in the case of meeting the conditions .If he must be talked to by the professor, output $-1$。
输入样例
1
3
mathematics physics signals
20
physics 10 1
physics 10 1
physics 10 1
physics 10 1
physics 10 1
physics 10 1
physics 10 1
mathematics 10 1
mathematics 10 1
mathematics 10 1
mathematics 10 1
mathematics 10 1
mathematics 10 1
mathematics 10 1
signals 10 1
signals 10 1
signals 10 1
signals 10 1
signals 10 1
signals 10 2
19 1
输出样例
190

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

源链接: HDU-6968

最后修改于 2021-10-23T19:10:51+00:00 由爬虫自动更新

共提交 0

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