Handball
InterviewTime limit2sMemory limit512 MB
Given each player's goal counts across M matches, count how many players scored at least once in every match.
- Level
Easy1 of 10
- Topics
- Array, Implementation
- Solved
- No attempts yet
Problem
A sports club is unhappy with its football results and decides to invest in its handball team. The coaching staff wants to judge players by their consistency, so they ask how many players scored in every single match.
A player counts as scoring in every match when the goal count is at least 1 in all matches. One match with 0 goals removes that player from the count.
The record set is large, so the counting has to be done by a program. Read the per-match goal record of each player and count how many players scored in every match.
Input
The first line contains two integers and , the number of players and the number of matches (, ).
Each of the next lines describes one player. The -th of these lines contains integers , where is the number of goals the -th player scored in the -th match ().
Output
Print one line with a single integer, the number of players who scored in every match.