Counting Monuments
Time limit2sMemory limit512 MB
Read n lines, each with a date and a monument name, and output the number of distinct monument names.
- Level
Easy2 of 10
- Topics
- Hash map, String, Implementation
- Solved
- No attempts yet
Problem
Alice loves visiting Paris. Every time she is in the city, she tries to see as many monuments as she can, and every day of her visit she notes down in her travel notebook which monument she saw that day. After many years and many trips to Paris, Alice wonders how many different monuments she has seen across all her visits. She shows you her travel notebook and asks for your help in computing this number.
Input
The input consists of n lines. Each line contains, first, a date (in the format YYYY-MM-DD), then a space, then the name of a monument. Names of monuments are character strings of arbitrary length containing arbitrary printable characters except for the newline character.
Output
The output consists of a single line whose content is an integer, the number m of distinct monuments in the input.
Constraints
- 1 ≤ n ≤ 1 000 000