
HDU
文章平均质量分 90
偶尔诈尸的老年人
Boys, be ambitious!
展开
-
[练习][HDU5187]快速幂加强(快速幂+快速乘) zhx's contest
题目背景 HDU5187题目描述 As one of the most powerful brushes, zhx is required to give his juniors nn problems. zhx thinks the ithi^{th} problem’s difficulty is ii. He wants to arrange these problems in a原创 2017-10-17 20:31:15 · 315 阅读 · 0 评论 -
[学习][HDU4300]字符串哈希 Clairewd's message
字符串哈希的简介 对于一个字符串,如ababab,把它当做一个数处理,如31进制数,那么它就是hash[i]=′a′∗315+′b′∗314+′a′∗313+′b′∗312+′a′∗31+′b′hash[i]='a'*31^5+'b'*31^4+'a'*31^3+'b'*31^2+'a'*31+'b'(用该字符的ASCII码计算),可以直接用进位的方法实现hash[i]=hash[i−1]∗31原创 2017-10-17 08:09:47 · 410 阅读 · 0 评论 -
[练习][HDU1502]DP Regular Words
题目背景 HDU1502题目描述 Consider words of length 3n over alphabet {A, B, C} . Denote the number of occurences of A in a word a as A(a) , analogously let the number of occurences of B be denoted as B(a), and原创 2017-10-10 22:09:02 · 274 阅读 · 0 评论 -
[复习][HDU1251]字典树(trie树)统计难题
题目背景 HDU 1251题目描述 Ignatius 最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀)。输入格式 输入数据的第一部分是一张单词表(不超过 104 个单词),每行一个单词,单词的长度不超过 10,它们代表的是老师交给 Ignatius 统计的单词,一个空行代表单词表的结束。第二原创 2017-07-12 23:22:25 · 327 阅读 · 0 评论 -
[复习][HDU1671]字典树(trie树)phone list
题目背景 HDU 1671题目描述 给出一份电话号码列表,如果不存在有一个号码是另一个号码的前缀,我们就说这份电话号码列表是合法的。让我们看看如下号码列表: 1. Emergency 911 2. Alice 97625999 3. Bob 91125426 在这组号码中,我们不能拨通 Bob 的电话,因为当你按下 Bob 电话号码的前 3 个数字“911”时,电话局会把你的拨号连原创 2017-07-12 16:30:59 · 403 阅读 · 0 评论