随笔分类 -  trie 字典树

D. Vitya and Strange Lesson
摘要:http://codeforces.com/contest/842/problem/D 1、整体的数组是不用变的,比如数组a[]经过一次询问x后,然后再询问y,相当于询问x ^ y ^ a[i]后的mex值 2、假设所求的答案是k,询问的数字是x,那么对于每个元素a[i],有a[i] ^ x != 阅读全文

posted @ 2017-09-02 19:55 stupid_one 阅读(283) 评论(0) 推荐(0) 编辑

EOJ Problem #3261 分词 trie + dp + 小剪枝
摘要:http://acm.ecnu.edu.cn/problem/3261/ 分词 Time limit per test: 1.0 seconds Time limit all tests: 1.0 seconds Memory limit: 256 megabytes 分词 Time limit p 阅读全文

posted @ 2017-05-13 13:30 stupid_one 阅读(377) 评论(0) 推荐(0) 编辑

P2001xor-sigma 字典树,然而好坑
摘要:https://vijos.org/p/2001 设perXor[i]表示1 i的前缀异或值。 那么要得到某一段的异或值,只需要perXor[j] ^ perXor[i - 1] 那么我们把perXor[n]先加入去字典树,然后用perXor[n - 1]去找,找到的就是下标n的贡献。 同理,然后把 阅读全文

posted @ 2016-12-22 23:01 stupid_one 阅读(191) 评论(0) 推荐(0) 编辑

hdu 1979 DFS + 字典树剪枝
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1979 Fill the blanks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S 阅读全文

posted @ 2016-11-25 22:42 stupid_one 阅读(447) 评论(0) 推荐(0) 编辑

hihoCoder 1383 : The Book List 北京网络赛
摘要:http://hihocoder.com/problemset/problem/1383?sid=950389 #1383 : The Book List #1383 : The Book List 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 The history 阅读全文

posted @ 2016-10-29 23:16 stupid_one 阅读(276) 评论(0) 推荐(0) 编辑

E. Beautiful Subarrays 字典树
摘要:http://codeforces.com/contest/665/problem/E 给定一个序列,问其中有多少个区间,所有数字异或起来 >= k 看到异或,就应该想到异或的性质,A^B^B = A,所以,用sum[i]表示1--i的异或值,那么i...j的异或值就是sum[j] ^ sum[i 阅读全文

posted @ 2016-09-19 12:48 stupid_one 阅读(334) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示