Distinguishing Lines by Style (for B&W printing)
Halden Cycle Hire's monthly pack is printed in black and white, so the coloured route lines all come out the same shade of grey. The fix is to give every route its own dash pattern -- solid, dashed, dotted -- and the print shop needs to know how many patterns to prepare before it can quote.
Task: Print how many different route names appear in the upload.
Input
The first line holds one integer n, the number of readings, where 1 <= n <= 1000. Then come n lines, each holding a day number, a route name and a value, separated by single spaces. Route names contain no spaces, and a route reports on as many days as it likes.
Output
One line holding a whole number: how many distinct route names there are. A route that filed ten readings still needs one dash pattern, and counts once.
Example:
Input:
3
1 A 10
1 B 20
1 C 30
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