P1935【Trie】图书管理员 | |
|
Description
你是一所学校的图书管理员,你的工作有如下几种操作:
A.添加一本书
B.借出一本书
C.查找一本书
你这学期要完成n次操作,非常辛苦,你想编写一个程序来帮助你。
Input Format
第一行一个整数n,表示操作的次数。
接下来n行,每行由一个大写字母和一个单词构成,大写字母表示操作的种类,单词表示对应的书名
Output Format
对于每次查询,输出查询的结果,找到输出"yes",没找到输出"no"。
Sample Input 1
10
A zerow
A alien
A newton
B jack
A nicole
C newton
B nicole
A pugna
C alien
C zerowb
Sample Output 1
yes
yes
no
Sample Input 2
30
A isaacus
A nicole
A lordwb
C lyf
A xiaomao
A heilleen
B lztwilliam
A lztwilliam
A dlztwilliam
C ylmf
B lyf
B elztwilliam
A ylmf
A pugna
A knicole
C xiaomao
A xiaomao
B jxiaomao
C root
C xiaomao
C iwq
C ylmf
B xiaomao
B nicole
C xiaomao
B xiaomao
A euserid
C nicole
A ylmf
C xiaomao
Sample Output 2
no
no
yes
no
yes
no
yes
yes
no
no
Sample Input 3
50
A nicole
A youling
A wq
A xiaomao
C puella
A ulordwb
C pugna
C puellapuel
C suserid
C isaacusnic
A youling
A jpuella
C useridryne
C youling
B pnewton
A root
B lztwillilz
C dxiaomao
C lyf
B lztwilli
C tpugna
C eilleen
C wqwq
B cxiaomao
B pugna
B isaacus
A ylordwb
A rootyoulin
A youling
C qyouling
B isaacuspue
A isaacus
B dlordwb
C eilleen
A lztwilli
B kwq
C ylmf
C isaacuslzt
C ypuella
C isaacus
B isaacus
C dylmf
C pugnaroot
B newton
B bnicole
A root
A pugna
B vpugna
A eilleen
C root
Sample Output 3
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
yes
no
no
yes
Hint
0<=n<=200000
书名长度不超过10