String---Prefix
Feynman1999
理论都是灰色的,而生活之树常青^_^
展开
-
Xor Sum(Trie)
problemZeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同意 Zeus 可以向人类...原创 2018-03-28 13:24:26 · 662 阅读 · 0 评论 -
逆序单词(Trie)
在英文中有很多逆序的单词,比如dog和god,evil和live等等。现在给出一份包含N个单词的单词表,其中每个单词只出现一次,请你找出其中有多少对逆序单词。Input第1行:1个整数,N,表示单词数量。2≤N≤50,000。第2..N+1行:每行1个单词,只包含小写字母,每个单词长度不超过16个字母。保证每个单词只出现一次,且不会出现回文单词(即一个单词倒序还是它自己,比如e...原创 2018-03-28 15:30:34 · 506 阅读 · 0 评论 -
判断是否每个串非别串前缀
problemAn encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in...原创 2018-03-28 21:54:49 · 306 阅读 · 0 评论 -
poj2001 串的唯一前缀标识
problemA prefix of a string is a substring starting at the beginning of the given string. The prefixes of “carbon” are: “c”, “ca”, “car”, “carb”, “carbo”, and “carbon”. Note that the empty string is...原创 2018-03-28 22:26:21 · 330 阅读 · 0 评论 -
HDU 1671 判断串是否是其他串的前缀
problemGiven 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...原创 2018-03-28 22:49:39 · 190 阅读 · 0 评论