08 2016 档案

摘要: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 阅读(374) 评论(0) 推荐(0)
摘要:线性筛分解质因子 今天多校有道题要分解质因子,以前单纯用线性筛找最小质因子放进一个vector里来算会t地不要不要的,队友用前向星存才过。 回来想了一下,既然线性筛能找到这个数的最小质因子,那么p^k x直接指向x不就可以了么。 这种做法时间复杂度O(n),空间O(n) 前向星遍历时按质因子从小到大 阅读全文
posted @ 2016-08-09 20:27 femsub 阅读(501) 评论(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 阅读(388) 评论(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 阅读(234) 评论(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 阅读(473) 评论(0) 推荐(0)
摘要:莫比乌斯反演个人小结 推荐 1.浅谈一类积性函数的前缀和(http://blog.csdn.net/skywalkert/article/details/50500009) 2.《贾志鹏线性筛》 3.《炫酷反演魔术》 这篇博客主要是学习了以上的东西的个人总结,如有错误请告知本人 假装大家现在没有看过 阅读全文
posted @ 2016-08-01 01:07 femsub 阅读(2014) 评论(1) 推荐(2)