One Function, Many Kinds: catplot
The Ravensworth Group cannot agree on how its team scores should be shown: boxes, violins, bars and plain dots all have advocates. Rather than rewriting the chart four times, the studio builds it through the one entry point that can produce any of them from the same arguments, and swaps a single word to compare. Whichever is chosen, the page needs the number of columns along the bottom.
Task: Print how many different teams appear.
Input
The first line holds one integer n, the number of records, where 1 <= n <= 1000. Then come n lines, each holding a team label and a score separated by a single space. Team labels contain no spaces, and a team may appear on any number of lines.
Output
One line holding a whole number: how many distinct team labels there are. A team with twenty records still gets one column, and counts once.
Example:
Input:
4
A 10
B 20
A 30
C 5
Output:
3
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in