摘要: 大家好,我是femsub。这个博客主要是用于分享我学到的有趣的东西,有空的话会整理一下一些知识点(((。 阅读全文
posted @ 2016-07-30 23:47 femsub 阅读(284) 评论(0) 推荐(1) 编辑
摘要: 柱爷搞子串 题目连接: (http://acm.uestc.edu.cn/ /problem/show/1485) Description 柱爷有一个字符串S,对于其中的每一个不同子串$S^\ast$,柱爷都能O(1) 的得到这些字符串的所有匹配位置 即能知道所有的[L,R] 区间使得 $S[L,R 阅读全文
posted @ 2016-09-15 23:38 femsub 阅读(392) 评论(0) 推荐(1) 编辑
摘要: 自然数幂和 一个经典的问题是求自然数幂和: $\sum_{i=1}^{n}i^k=1^k+2^k+...+n^k$ 根据伯努利的公式: $\sum_{i=1}^{n}i^k=\frac{1}{k+1}\sum_{i=1}^{k+1}C_{k+1}^{i}B_{k+1 i}(n+1)^i$条件:$B_ 阅读全文
posted @ 2016-09-02 13:43 femsub 阅读(433) 评论(0) 推荐(1) 编辑
摘要: AVL Trees 题目连接: (http://codeforces.com/gym/100341) 题意 avl树是每棵子树的左右子树高度之差小于等于1,给你节点个数和树高,问有多少种树 题解: 很轻松地我们写出dp: dp[h][n]表示树高h+1,n个节点的答案 $dp[h][n]=\sum_ 阅读全文
posted @ 2016-08-24 20:53 femsub 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 线性筛分解质因子 今天多校有道题要分解质因子,以前单纯用线性筛找最小质因子放进一个vector里来算会t地不要不要的,队友用前向星存才过。 回来想了一下,既然线性筛能找到这个数的最小质因子,那么p^k x直接指向x不就可以了么。 这种做法时间复杂度O(n),空间O(n) 前向星遍历时按质因子从小到大 阅读全文
posted @ 2016-08-09 20:27 femsub 阅读(475) 评论(0) 推荐(0) 编辑
摘要: Ant Man 题目连接: (http://codeforces.com/contest/704/problem/B) Description Scott Lang is at war with Darren Cross. There are n chairs in a hall where the 阅读全文
posted @ 2016-08-08 19:35 femsub 阅读(384) 评论(0) 推荐(0) 编辑
摘要: Maze Mayhem 题目连接: (https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4926) 题意 n m的格子,给你一个k,表示你最多可 阅读全文
posted @ 2016-08-03 21:08 femsub 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Prefix 题目连接: (http://acm.hdu.edu.cn/showproblem.php?pid=5790) Description Alice gets N strings. Now she has Q questions to ask you. For each question, 阅读全文
posted @ 2016-08-02 20:07 femsub 阅读(470) 评论(0) 推荐(0) 编辑
摘要: 莫比乌斯反演个人小结 推荐 1.浅谈一类积性函数的前缀和(http://blog.csdn.net/skywalkert/article/details/50500009) 2.《贾志鹏线性筛》 3.《炫酷反演魔术》 这篇博客主要是学习了以上的东西的个人总结,如有错误请告知本人 假装大家现在没有看过 阅读全文
posted @ 2016-08-01 01:07 femsub 阅读(2000) 评论(1) 推荐(2) 编辑
摘要: Shell Necklace 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5730 Description Perhaps the sea‘s definition of a shell is the pearl. However, in my v 阅读全文
posted @ 2016-07-31 16:27 femsub 阅读(595) 评论(0) 推荐(0) 编辑
摘要: Filling 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5766 Description The board is a rectangle of unit cells with N rows and N columns. At first, c 阅读全文
posted @ 2016-07-31 00:51 femsub 阅读(617) 评论(0) 推荐(0) 编辑