随笔分类 -  HDU

自己写过的HDU题
摘要:若不熟悉KMP算法,强烈建议好好先去了解一下,否则这里会有很多不大理解的思想。 Trie树上的KMP? 想想原本的$KMP$算法,为了快速匹配,我们根据匹配串先预处理一个$next[]$数组,也就是最长的后缀与前缀完全匹配的位置,然后一旦遇到匹配错误的时候,就把当时的匹配指针移到他的$next[]$ 阅读全文
posted @ 2019-03-22 20:26 Hëinz 阅读(156) 评论(0) 推荐(0)
摘要:题目描述: 给出一个长度为n的01串S,有Q个操作: 1. 翻转区间$[l,r]$(0变1,1变0) 2. 求区间$[l,r]$有多少不同的子串 思路: 看到这题:区间修改,区间询问,不难想到线段树,不过如何快速DP转移? 首先先考虑原本暴力DP的方法,$dp[x][flag]$为前$x$个数中以$ 阅读全文
posted @ 2019-03-01 22:11 Hëinz 阅读(315) 评论(0) 推荐(0)
摘要:题目描述: Now we are planning to construct a big chimney. The chimney’s section is a 3×3 square and the center of it will have nothing like the picture be 阅读全文
posted @ 2019-03-01 22:10 Hëinz 阅读(167) 评论(0) 推荐(0)
摘要:题目描述: On Octorber 21st, HDU 50 year celebration, 50 color balloons floating around the campus, it's so nice, isn't it? To celebrate this meaningful da 阅读全文
posted @ 2019-03-01 22:07 Hëinz 阅读(153) 评论(0) 推荐(0)
摘要:题目描述: RPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Gras 阅读全文
posted @ 2019-03-01 21:58 Hëinz 阅读(202) 评论(0) 推荐(0)
摘要:题目描述: C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数 阅读全文
posted @ 2019-03-01 21:55 Hëinz 阅读(228) 评论(0) 推荐(0)
摘要:题目描述: Lady CA has a tree with n points numbered 1,2,...,n , and each edge has its weight. The unique route connecting two points is called a chain, an 阅读全文
posted @ 2019-03-01 21:31 Hëinz 阅读(200) 评论(0) 推荐(0)
摘要:题目描述: Given a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour of A[n] is 阅读全文
posted @ 2019-03-01 21:09 Hëinz 阅读(194) 评论(0) 推荐(0)