摘要: 1。单调队列优化dp 模板题:https://loj.ac/problem/10175 模板:https://www.cnblogs.com/junk-yao-blog/p/9503850.html 2。主席树 模板题:https://www.luogu.org/problemnew/show/P3 阅读全文
posted @ 2018-08-21 15:22 junk_yao 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 思路: nxt数组依次输出即可。 阅读全文
posted @ 2018-08-21 10:27 junk_yao 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 思路:(以下为引用内容) 考虑整个串,根据next数组的定义,前后匹配并且前缀和相等的最长的后缀之间没有交叉,那么相等的部分的长度为next[n],并且从左往右相等。 如果希望中间的也是有s[1..next[n]]的几个循环组成,那么整个串就以next[n]为最小周期,但是如果这样,next[n]就 阅读全文
posted @ 2018-08-21 09:54 junk_yao 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 思路: 简单KMP 阅读全文
posted @ 2018-08-21 09:10 junk_yao 阅读(207) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; const int maxn = 110; int n; struct bignum{ int num[203]; bignum(){ memset(num, 0, sizeof(num)); num[0] = 1; } void sho... 阅读全文
posted @ 2018-08-21 08:50 junk_yao 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; const int maxn = 110; int n; struct bignum{ int num[203]; bignum(){ memset(num, 0, sizeof(num)); num[0] = 1; } void sho... 阅读全文
posted @ 2018-08-21 08:48 junk_yao 阅读(109) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; const int maxn = 110; int n, dp[maxn]; int main(void){ dp[1] = 1; dp[2] = 2; dp[3] = 3; for(int i = 4; i <= 60; ++i) dp[i] = dp... 阅读全文
posted @ 2018-08-21 08:38 junk_yao 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 愉快的刷水题!!! 恢复内容结束 阅读全文
posted @ 2018-08-21 08:30 junk_yao 阅读(80) 评论(0) 推荐(0) 编辑