上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 24 下一页
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6156 【AC】 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const ll mod=1e9+7; 5 i 阅读全文
posted @ 2017-08-20 22:07 shulin15 阅读(159) 评论(0) 推荐(0) 编辑
摘要: acm.hdu.edu.cn/showproblem.php?pid=6153 【题意】 给定字符串A和B,求B的所有后缀在A中出现次数与其长度的乘积之和 A和B的长度最大为1e6 方法一:扩展kmp 【思路】 把A和B同时反转,相当于求B的所有前缀在A中出现次数与其长度的乘积之和 换个角度,相当于 阅读全文
posted @ 2017-08-20 17:41 shulin15 阅读(377) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4333 【题意】 给定一个数字<=10^100000,每次将该数的第一位放到放到最后一位,求所有组成的不同的数比原数小的个数,相等的个数,大的个数 【思路】 这个数很大,用字符串处理 比较两个字符串的大小,一位一位 阅读全文
posted @ 2017-08-20 13:37 shulin15 阅读(265) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2752 【题意】 给定一个字符串,求这个字符串的所有公共前后缀的长度,按从小到达输出 【思路】 利用kmp的next数组,最后加上这个字符串本身 【AC】 1 #include<iostream> 2 #include<cstring> 3 #i 阅读全文
posted @ 2017-08-20 08:52 shulin15 阅读(238) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2406 【题意】 给定字符串s,s=a^n,a是s的子串,求n最大是多少 【思路】 kmp中的next数组求最小循环节的应用 例如 ababab next[6] = 4; 即 ababab ababab 1~4位 与2~6位是相同的 那么前两位 阅读全文
posted @ 2017-08-20 08:27 shulin15 阅读(160) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2089 【AC】 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn=1e6+2; 5 阅读全文
posted @ 2017-08-18 22:29 shulin15 阅读(190) 评论(0) 推荐(0) 编辑
摘要: https://www.bnuoj.com/v3/problem_show.php?pid=52781 【AC】 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn=5e5 阅读全文
posted @ 2017-08-18 21:48 shulin15 阅读(244) 评论(0) 推荐(0) 编辑
摘要: acm.hdu.edu.cn/showproblem.php?pid=6127 【题意】 给定平面直角坐标系中的n个点,这n个点每个点都有一个点权 这n个点两两可以连乘一条线段,定义每条线段的权值为线段两端点点权的乘积 现在要过原点作一条直线,要求这条直线不经过任意一个给定的点 在所有n个点两两连成 阅读全文
posted @ 2017-08-16 20:20 shulin15 阅读(221) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=6129 【题意】 对于一个长度为n的序列a,我们可以计算b[i]=a1^a2^......^ai,这样得到序列b 重复这样的操作m次,每次都是从上次求出的序列a得到一个新序列b 给定初始的序列,求重复m次操作后得到 阅读全文
posted @ 2017-08-16 19:00 shulin15 阅读(232) 评论(0) 推荐(0) 编辑
摘要: acm.hdu.edu.cn/showproblem.php?pid=3037 【题意】 m个松果,n棵树 求把最多m个松果分配到最多n棵树的方案数 方案数有可能很大,模素数p 1 <= n, m <= 1000000000, 1 < p < 100000 【思路】 答案为C(n+m,m)%p 对于 阅读全文
posted @ 2017-08-16 14:54 shulin15 阅读(166) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 24 下一页