#K57542. Unique Score Teams
Unique Score Teams
Unique Score Teams
You are given a list of participants where each participant is represented by a pair of integers: a score and an ID. Your task is to form teams such that each selected team has a unique score. In other words, you need to count the maximum number of teams you can form using participants whose scores are distinct.
More formally, if the set of scores extracted from the list is \(S\), then the answer is \(|S|\), the number of unique scores.
Note: Even if multiple participants share the same score, they can contribute only once to the count of distinct scores.
inputFormat
The input is read from standard input (stdin) and has the following format:
- An integer
n
representing the number of participants. n
lines follow, each containing two space-separated integers:score
andID
.
It is guaranteed that n \ge 0
. When n = 0
, there are no participant lines.
outputFormat
Output to standard output (stdout) a single integer representing the maximum number of teams that can have distinct scores.
## sample6
95 1
92 2
93 3
94 4
95 5
96 6
5