#abc228c. C - Final Day
C - Final Day
Score : points
问题陈述
名学生正在进行一场为期 天的考试。
每天有 分的测试题,总计 分。
前三天的考试已经结束,现在即将开始第四天的考试。第 名学生()在第 天()获得了 分。
对于每位学生,确定在第四天结束后他/她是否有可能排名前 位。 这里,第四天结束后学生的排名定义为:总分高于该学生的同学数加 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
students are taking a -day exam.
There is a -point test on each day, for a total of points.
The first three days of the exam are already over, and the fourth day is now about to begin. The -th student got points on the -th day .
For each student, determine whether it is possible that he/she is ranked in the top after the fourth day.
Here, the rank of a student after the fourth day is defined as the number of students whose total scores over the four days are higher than that of the student, plus .
Constraints
- $0 \leq P_{i, j} \leq 300 \, (1 \leq i \leq N, 1 \leq j \leq 3)$
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain Yes
if it is possible that the -th student is ranked in the top after the fourth day, and No
otherwise.
Sample Input 1
3 1
178 205 132
112 220 96
36 64 20
Sample Output 1
Yes
Yes
No
If every student scores on the fourth day, the -st student will rank -st.
If the -nd student scores and the other students score on the fourth day, the -nd student will rank -st.
The -rd student will never rank -st.
Sample Input 2
2 1
300 300 300
200 200 200
Sample Output 2
Yes
Yes
Sample Input 3
4 2
127 235 78
192 134 298
28 56 42
96 120 250
Sample Output 3
Yes
Yes
No
Yes
update @ 2024/3/10 09:58:29