#Q36. 「一本通 2.1 例 2」图书管理
「一本通 2.1 例 2」图书管理
Description
Managing books is a highly complex task, with many new books being added to a library every day. To facilitate easier book management (and to help patrons quickly determine if the books they need are available), we need to design a book search system.
This system needs to support two operations:
add(s)indicates adding a new book with the titles.find(s)queries whether a book with the titlesexists.
Input Format
The first line contains a positive integer , representing the number of operations. The following lines each specify one of the two operations in the format:
add s
find s
There is a space separating the book title s and the command (add or find). We guarantee that the length of all book titles does not exceed . The input data can be assumed to be accurate.
Output Format
For each find(s) command, you must output a corresponding line with yes or no, indicating whether the queried book currently exists in the library.
Note: Initially, the library contains no books. Additionally, book titles with the same letters but different cases are considered distinct.
Sample 1
4
add Inside C#
find Effective Java
add Effective Java
find Effective Java
no
yes
Constraints and Hints
.