![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字典树
q435201823
11
展开
-
CSU - 1216 - 异或最大值(字典树)
给定一些数,求这些数中两个数的异或值最大的那个值Input 多组数据。第一行为数字个数n,1 <= n <= 10 ^ 5。接下来n行每行一个32位有符号非负整数。Output 任意两数最大异或值Sample Input 3 3 7 9 Sample Output 14 Hint [分析] 就是字典树,然后儿子只有0和1[代码]#inclu...原创 2018-08-11 20:20:34 · 175 阅读 · 0 评论 -
HDU - 4825 - Xor Sum(字典树)
Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同意 Zeus 可以向人类求助。你能证明人类...原创 2018-08-11 20:23:35 · 113 阅读 · 0 评论