上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 41 下一页
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1711 题意就是求b数组在a数组出现的位置;就是kmp模板; #include<stdio.h> #include<iostream> #include<algorithm> #include<strin Read More
posted @ 2015-09-24 12:49 西瓜不懂柠檬的酸 Views(116) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=3461 和 减花布条 的题对比一下; 求s2中s1的个数kmp模板; #include<stdio.h> #include<iostream> #include<algorithm> #include<string.h> using n Read More
posted @ 2015-09-23 20:56 西瓜不懂柠檬的酸 Views(164) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=2406 题意:就是求串s能够最多由多少个相同的串a串联而成; 例如 ababab 由3个ab串联而成; abababa 只能由1个abababa组成; kmp中的Next[n](下标从0开始)表示n个元素的前缀和后缀的最大匹配; a b Read More
posted @ 2015-09-23 20:00 西瓜不懂柠檬的酸 Views(118) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2087 kmp模板题: #include <cstdio> #include <cstring> #include <iostream> using namespace std; #define N 11 Read More
posted @ 2015-09-23 15:55 西瓜不懂柠檬的酸 Views(329) Comments(0) Diggs(0)
#include#include#include#include#include#includeusing namespace std;#define N 500000#define mod 1000000007__int64 a[N], b[N], ans[N];void Init(){ i... Read More
posted @ 2015-09-23 10:20 西瓜不懂柠檬的酸 Views(365) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=3070.就是斐波那契的另一种表示方法是矩阵的幂;所以是矩阵快速幂;矩阵快速幂学习#include #include #include #include #includeusing namespace std;#define N 10st... Read More
posted @ 2015-09-20 21:26 西瓜不懂柠檬的酸 Views(212) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5455就是求字符串中含有几个f[i], 输出最小的;例如fff应该是2,有f[0]和f[1]组成的;ffcffc也是2是有个cff组成的,因为字符串是一个环;#include #include #incl... Read More
posted @ 2015-09-20 10:58 西瓜不懂柠檬的酸 Views(140) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=1502题意:求从处理器1到其它处理器所需的最少时间是多少;输入是下三角,如果是x表示A【i】【j】不能直接联系;#include #include #include #include #include using namespace s... Read More
posted @ 2015-09-16 16:01 西瓜不懂柠檬的酸 Views(266) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5441题意:是有n个城市,m条边包含u v w;代表u到v的时间是w;给q的时间x,求在x时间内Jack可以到达多少对城市;其中ab和ba是不同的;15 5 32 3 63341 5 157243 5 5... Read More
posted @ 2015-09-16 11:10 西瓜不懂柠檬的酸 Views(337) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5444 有一个序列,由这个序列可以画出一颗二叉树(每个节点的左边(W)都比它大,右边(E)都比它小),我们每次从树根出发每次向左向右的找到对应的点,求这个过程是怎样的用WE表示; 最近刚好看到了数据结构, Read More
posted @ 2015-09-16 10:05 西瓜不懂柠檬的酸 Views(191) Comments(0) Diggs(0)
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 41 下一页
levels of contents