
字典树
creator平
期望破茧成蝶时的飞翔,向往突破蝉蛹后的鸣叫。
展开
-
HDU - 1251——统计难题
Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提...原创 2018-05-04 09:05:19 · 174 阅读 · 0 评论 -
HDU - 1671——Phone List (字符串是否为另一字符串的前缀)
Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers: 1. Emergency 911 2. Alice 97 62...原创 2018-05-04 17:16:00 · 184 阅读 · 0 评论 -
HDU - 2072——单词数
lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。 Input 有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。 Output 每组只输出一个整数,其单...原创 2018-05-04 20:42:27 · 188 阅读 · 3 评论 -
HDU - 1075——What Are You Talking About (单词翻译)
Ignatius is so lucky that he met a Martian yesterday. But he didn't know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves. Now Ignatius want ...原创 2018-05-05 21:41:34 · 768 阅读 · 0 评论 -
HDU - 1247——Hat’s Words (字符串拆分)
A hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary. You are to find all the hat’s words in a dictionary. Input Standar...原创 2018-05-07 09:27:59 · 289 阅读 · 0 评论 -
HDU - 4825——Xor Sum (异或最大值)
Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同意 Zeus 可以向人类求助。你能证明人类...原创 2018-05-07 17:55:37 · 606 阅读 · 0 评论 -
HDU - 1298——T9 (九宫格拼音模拟)
A while ago it was quite cumbersome to create a message for the Short Message Service (SMS) on a mobile phone. This was because you only have nine keys and the alphabet has more than nine letters, so ...原创 2018-05-08 18:20:24 · 2734 阅读 · 0 评论