
acm之路
临yuan羡鱼
退而结网
展开
-
POJ 3561
#include#include#includeusing namespace std;const int N=20000+10;int arr[N];typedef unsigned long long ll;const int Mod=1e6+7;ll xp[N],hash[N],hash2[N];int n,k;bool check(int len){ int原创 2014-04-22 20:52:28 · 642 阅读 · 0 评论 -
HDU 2222
1.题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=22222.题意:求许多短串在一个长串里出现的个数分析:原本想用hash求各个串的hash值,依次匹配,结果TLE了。只能去学一学AC自动机了,刚好这是一道AC自动机的例题。最难的就是建立fail指针,和KMP的next指针差不多。原创 2014-04-22 21:03:40 · 566 阅读 · 0 评论 -
POJ 1001 高精度实数相乘与快速幂
题目链接:http://poj.org/problem?id=1001题意:原创 2014-05-09 20:56:41 · 1447 阅读 · 0 评论 -
HDU 2594 KMP next数组的又一用法
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2594题意:给两个原创 2014-05-09 21:14:26 · 1103 阅读 · 1 评论 -
ZOJ 3623 DP问题
题意:像星际争霸的游戏,造飞船来原创 2014-07-05 17:21:06 · 537 阅读 · 0 评论 -
POJ 1050 动态规划水题
思路:一开始想用dp[i][j]代表以它为结尾的最大值原创 2014-06-20 16:13:33 · 697 阅读 · 0 评论 -
POJ 3278 BFS水题
题意:一个人在一维坐标上抓牛原创 2014-11-22 11:28:05 · 487 阅读 · 0 评论