Candies Time Limit: 1500MS Memory Limit: 131072K Total Submissions: 32572 Accepted: 9107 Description During the kindergarten days, flymouse was the monitor of his class. Occas…
poj 1000 a+b 1006 数论 中国剩余定理 1023 数论 进制转换 1061 数论 exgcd 1088 搜索/DP dfs 1125 图论 最短路 1152 数论 进制转换 1159 DP 区间型 ...
Milking Grid Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 8062 Accepted: 3493 Description Every morning when they are milked, the Farmer John's cows form a recta…
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17581 Accepted: 9019 Description The little cat is so famous, that many couples tramp o…
首先,我们来观察一下fail数组(不知道fail数组的请访问:KMP算法详解),我们发现一个串若是一个可以有一个子串多次拼接而成的,则其fail数组的值一定是从第一次循环这个子串的那一位依次递增,同时这个子串一定是这个串的最小的循环节。 所以我们根据这个性质,可以解决不少问题 poj 2406: ...
KMP KMP算法是一种改进的字符串匹配算法,由D.E.Knuth,J.H.Morris和V.R.Pratt同时发现,因此人们称它为 克努特——莫里斯——普拉特 操作(简称KMP算法)。KMP算法的关键是利用匹配失败后的信息,尽量减少模式串与主串的匹配次数以达到快速匹配的目的。具体实现就是实现一个next()函数,函数本身包含了模式串的局部匹配信息…
Is It A Tree? Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 30470 Accepted: 10369 Description A tree is a well-known data structure that is either empty (null, vo…
Balance Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 13761 Accepted: 8652 Description Gigel has a strange "balance" and he wants to poise it. Actually, the devic…
放苹果 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 31107 Accepted: 19624 Description 把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。 Input 第一行是…
Maze Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 3846 Accepted: 1220 Description Acm, a treasure-explorer, is exploring again. This time he is in a special maze…