#C11957. Count Proficient Players in Game
Count Proficient Players in Game
Count Proficient Players in Game
You are given a list of players in an online game. Each player has a number of skills, and each skill has an associated level. A player is considered proficient if they have at least one skill at a specified level L.
The input starts with three integers: N (the number of different skills available in the game), L (the target skill level), and M (the number of players). This is followed by a sequence of integers giving the details for each player. For each player, the first integer denotes the number of skills the player has, and it is followed by pairs of integers. Each pair contains a skill id and its corresponding skill level.
A player is proficient if there exists at least one pair such that the skill level equals L
.
The task is to count the number of proficient players.
Formally, if for each player i, they have ki skills represented as pairs \((s_{i1}, l_{i1}), (s_{i2}, l_{i2}), \dots, (s_{ik_i}, l_{ik_i})\), then player i is proficient if and only if there exists an index \(j\) such that \(l_{ij} = L\). Output the total count of proficient players.
Note: Input is provided via standard input (stdin) and output should be printed to standard output (stdout).
inputFormat
The input consists of several space-separated integers:
- The first three integers are \(N\), \(L\), and \(M\), where:
- \(N\) is the number of different skills.
- \(L\) is the target skill level.
- \(M\) is the number of players.
- This is followed by a sequence of integers describing the players. For each player, the first integer indicates \(k\) (the number of skills the player has), and it is followed by \(2 \times k\) integers representing \(k\) pairs of skill id and skill level.
All input is read from stdin.
outputFormat
Print a single integer representing the number of proficient players. Output should be written to stdout.
## sample3 5 3 2 1 4 2 5 1 1 1 1 3 5
2