algorithm
文章平均质量分 86
木化十
这个作者很懒,什么都没留下…
展开
-
kmp算法(最简单最直观的理解,看完包会)
本文将以特殊的方式来让人们更好地理解kmp算法,不包括kmp算法的推导,接下来,我们将从朴素算法出发。 在这之前,我们先设主串为S,模式串为T,我们要解决的询问是主串中是否包含模式串(即T是否为S的字串)。 版权声明:本文为原创文章,转载请标明出处。朴素算法朴素算法说白了就是暴力,简单地讲就是先从主串的第一个位置开始逐个对模式串进行匹配, 若匹配失败,则从主串的第二个位置继续进行匹配...原创 2018-08-07 11:42:21 · 16912 阅读 · 12 评论 -
poj3422 Kaka's Matrix Travels
题面On an N × N chessboard with a non-negative number in each grid, Kaka starts his matrix travels with SUM = 0. For each travel, Kaka moves one rook from the left-upper grid to the right-bottom one, ...原创 2018-09-12 19:44:14 · 184 阅读 · 0 评论 -
bzoj1001 狼抓兔子
题意现在小朋友们最喜欢的”喜羊羊与灰太狼”,话说灰太狼抓羊不到,但抓兔子还是比较在行的, 而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点为(1,1),右下角点为(N,M)(上图中N=4,M=5).有以下三种类型的道路 1:(x,y)<==>(x+1,y) 2:(x,y)<==>(x,y+1) 3:(x...原创 2018-09-11 00:05:35 · 251 阅读 · 0 评论 -
POJ - 2186 Popular Cows
题面Every cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs原创 2018-09-14 19:27:36 · 167 阅读 · 0 评论 -
OpenJ_Bailian - 2375 Cow Ski Area
题目连接:http://bailian.openjudge.cn/practice/2375?lang=en_US题面Farmer John’s cousin, Farmer Ron, who lives in the mountains of Colorado, has recently taught his cows to ski. Unfortunately, his cows ar...原创 2018-09-15 12:33:16 · 243 阅读 · 0 评论 -
HDU - 1669 Jamie's Contact Groups
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1669题面:Jamie is a very popular girl and has quite a lot of friends, so she always keeps a very long contact list in her cell phone. The contact lis...原创 2018-09-15 12:42:41 · 446 阅读 · 0 评论 -
POJ - 1236 Network of Schools
题目链接:http://poj.org/problem?id=1236题面:DescriptionA number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of sc...原创 2018-09-15 12:55:03 · 224 阅读 · 0 评论