A8431 | Marks
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Vasya, or Mr. Vasily Petrov is a dean of a department in a local university. After the winter exams he got his hands on a group's gradebook.
Overall the group has $n$ students. They received marks for $m$ subjects. Each student got a mark from $1$ to $9$ (inclusive) for each subject.
Let's consider a student the best at some subject, if there is no student who got a higher mark for this subject. Let's consider a student successful, if there exists a subject he is the best at.
Your task is to find the number of successful students in the group.
Overall the group has $n$ students. They received marks for $m$ subjects. Each student got a mark from $1$ to $9$ (inclusive) for each subject.
Let's consider a student the best at some subject, if there is no student who got a higher mark for this subject. Let's consider a student successful, if there exists a subject he is the best at.
Your task is to find the number of successful students in the group.
输入格式
The first input line contains two integers $n$ and $m$ ( $1<=n,m<=100$ ) — the number of students and the number of subjects, correspondingly. Next $n$ lines each containing $m$ characters describe the gradebook. Each character in the gradebook is a number from $1$ to $9$ . Note that the marks in a rows are not sepatated by spaces.
输出格式
Print the single number — the number of successful students in the given group.
输入输出样例
输入 #1
3 3 223 232 112
输出 #1
2
输入 #2
3 5 91728 11828 11111
输出 #2
3
In the first sample test the student number $1$ is the best at subjects $1$ and $3$ , student $2$ is the best at subjects $1$ and $2$ , but student $3$ isn't the best at any subject.
In the second sample test each student is the best at at least one subject.
In the second sample test each student is the best at at least one subject.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted