![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
文章平均质量分 53
naturelan
这个作者很懒,什么都没留下…
展开
-
hdu_2617 Happy 2009 (字符串)
分析:一开始递归了一下,果然就 TLE 了,然后看了解题报告,豁然开朗,觉得解法挺巧妙的,看代码比较清楚就不在赘述了~代码:#include #include #include using namespace std;#define M 10010char s[M];int main(){ int len; int h,a,p,y; while原创 2013-12-30 00:14:41 · 1096 阅读 · 0 评论 -
hdu_3819 A and B Problem (字符串)
http://acm.hdu.edu.cn/showproblem.php?pid=3819分析:代码:#include #include #include #include using namespace std;#define M 100001int ans[M];int main(){ //freopen("in.txt","r",stdin);原创 2014-01-13 10:51:44 · 786 阅读 · 0 评论 -
hdu_1082 Matrix Chain Multiplication (字符串)
http://acm.hdu.edu.cn/showproblem.php?pid=1082分析:虽然矩阵连乘是动态规划的经典题型,但是这道题却只是对字符串的处理——括号运算的处理。所以利用栈来处理。当遇到矩阵时入栈,遇到“)” 弹出连个矩阵进行运算,并将运算结果压栈。另者在矩阵相乘时注意两个矩阵是否满足相乘条件。代码:#include #include #原创 2014-01-17 13:50:54 · 957 阅读 · 0 评论 -
shu_1180 回文数(一)
http://202.121.199.212/JudgeOnline/problem.php?cid=1079&pid=21分析: 回文串判断,字符串处理 1. atoi 函数(ascii tointeger 将字符串转换成整型数) 头文件: #include int atoi(cons原创 2014-07-08 14:41:17 · 822 阅读 · 0 评论 -
poj_2752 Seek the Name, Seek the Fame
http://poj.org/problem?id=2752分析:原创 2014-09-14 21:52:09 · 857 阅读 · 0 评论 -
poj_1961 Period
http://poj.org/problem?id=1961分析: S的长度为i的前缀可以表示成A^K形式,求i和K。KMP中next数组的应用。Out:2 26 29 312 4 依次继续,由于整除最后蓝色小块与红色小块会重合,H=T,所以 K=i/(i-next[i]);2.2原创 2014-09-15 20:10:47 · 565 阅读 · 0 评论