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

建议使用的浏览器:

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

3778:An Odd Award Rule

题目描述
The education of primary school in China is a big problem now. A teacher must be very careful not only when he/she is criticizing the students, but also when he/she is giving awards to good students. Teacher Liu always gave the top ten students on his examination some little awards before, but some parents are a little bit angry about this now. They say that their little kids may get hurt because they will never get the awards. Teacher Liu has to change his award rule. He wants all students have a chance to win the awards, no matter their scores are good or poor. But he still wants good students to get more chance. So the new rule seems a little bit odd: anyone whose score equals to the sum of the scores of OTHER 3 or 2 students, will win the award. Now figuring out who is qualified for the awards seems a little bit hard for Teacher Liu. As the monitor of his class and a little programmer, you should help him to do this.
输入解释
For each test case, first print an integer in a line, indicating how many students win the awards. Then print the names of those who win the awards in alphabetic order, each name in a line.
输出解释
For each test case, print one line containing an integer which equals to the formula’s value mod P.
输入样例
1
5
SIKE 12
WORRY 20
LUCENT 8
KILI 3
TOM 1
输出样例
2
SIKE
WORRY

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3778

最后修改于 2020-10-29T07:11:10+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536