Adding Point Markers to a Line
Halden Cycle Hire publishes a weekly trend chart, and readers keep asking how much data is actually behind the line. The fix agreed with the design team is a dot on every reading plus a caption saying how many readings there were, so a line drawn through four points is never mistaken for a line drawn through four hundred.
Task: Print how many readings the upload contains.
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 and a value separated by a single space. Days may repeat when more than one depot reported.
Output
One line holding a whole number, with no decimal point: how many readings were uploaded. Every reading counts separately, including two that share a day.
Example:
Input:
4
1 10
2 20
3 15
4 25
Output:
4
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