上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 40 下一页

2013年9月29日

【专题】KMP

摘要: 挖坑...----------------------------一 模板----------------------------const int maxn=1111111;char P[maxn];char T[maxn];int f[maxn];void getFail(char P[],int f[]){ int i=0,j=-1; int len=strlen(P); f[0]=-1; while (i f[n] ] 是最长的子串,既是是s的前缀又是s的后缀,同理1 -> f[ f[n] ] 是次短的...依次递归 while (f[n]>0){... 阅读全文

posted @ 2013-09-29 15:27 电子幼体 阅读(148) 评论(0) 推荐(0) 编辑

2013年9月28日

UVA 10816 Travel in Desert 最短路+二分

摘要: --------------------DescriptionThere is a group of adventurers who like to travel in the desert. Everyone knowstravellingin desert can be very dangerous. That's why they plan their trip carefully every time. There are a lot of factors to consider before they make their final decision.One of the 阅读全文

posted @ 2013-09-28 20:51 电子幼体 阅读(167) 评论(0) 推荐(0) 编辑

2013年9月26日

UVA 10600 ACM Contest and Blackout 次小生成树/裸

摘要: ----------Problem AACM CONTEST AND BLACKOUTIn order to prepare the “The First National ACM School Contest”(in 20??) the major of the city decided to provide all the schools with a reliable source of power. (The major is really afraid of blackoutsJ). So, in order to do that, power station “Future” an 阅读全文

posted @ 2013-09-26 13:12 电子幼体 阅读(230) 评论(0) 推荐(0) 编辑

2013年9月25日

Poj 3552 Slim Span 最小生成树

摘要: -----------------Slim SpanTime Limit:5000MSMemory Limit:65536KTotal Submissions:5725Accepted:3008DescriptionGiven an undirected weighted graphG, you should find one of spanning trees specified as follows.The graphGis an ordered pair (V,E), whereVis a set of vertices {v1,v2, …,vn} andEis a set of und 阅读全文

posted @ 2013-09-25 21:13 电子幼体 阅读(153) 评论(0) 推荐(0) 编辑

UVA 11354 - Bond 最小树/LCA/瓶颈路

摘要: -----------------------Once again, James Bond is on his way to saving the world. Bond's latest mission requires him to travel between several pairs of cities in a certain country.The country hasNcities (numbered by 1, 2, . . .,N), connected byMbidirectional roads. Bond is going to steal a vehicl 阅读全文

posted @ 2013-09-25 18:39 电子幼体 阅读(203) 评论(0) 推荐(0) 编辑

HDU 4081 Qin Shi Huang's National Road System 最小/次小生成树的性质

摘要: ------------------------------Qin Shi Huang's National Road SystemTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2168Accepted Submission(s): 789Problem DescriptionDuring the Warring States Period of ancient China(476 BC to 221 BC), there were 阅读全文

posted @ 2013-09-25 14:29 电子幼体 阅读(250) 评论(0) 推荐(0) 编辑

2013年9月23日

UVA 10269 Adventure of Super Mario floyd dp

摘要: Problem AAdventure of Super MarioInput:Standard InputOutput:Standard OutputAfter rescuing the beautiful princess, Super Mario needs to find a way home -- with the princess of course :-) He's very familiar with the 'Super Mario World', so he doesn't need a map, he only needs the best 阅读全文

posted @ 2013-09-23 20:26 电子幼体 阅读(190) 评论(0) 推荐(0) 编辑

UVA 11280 Flying to Fredericton 最短路DP

摘要: Problem CFLYING TO FREDERICTONAfter being inspired by Salvador Dali's artwork, Brett decided he would like to travel to Fredericton, New Brunswick to visit the Beaverbrook Art Gallery.Brett lives in Calgary, and would like to find the cheapest flight or flights that would take him to Fredericton 阅读全文

posted @ 2013-09-23 20:19 电子幼体 阅读(209) 评论(0) 推荐(0) 编辑

2013年9月17日

【专题】树状数组

摘要: ------------------------------学习资料------------------------------http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binaryIndexedTreeshttp://hi.baidu.com/wyl8899/item/c3ac1c0eec3516ea34990267http://hi.baidu.com/solofancy/item/a6b7da6abdea54126995e65fhttp://blog.csdn.net/pkqs90/art 阅读全文

posted @ 2013-09-17 21:47 电子幼体 阅读(95) 评论(0) 推荐(0) 编辑

【专题】Subsequence

摘要: 回文子序列----------------------------最长回文子序列题目略----------------------------这是回文子序列的基础,直接DP即可。f[ L ][ R ] 表示区间[ L , R ] 的最长回文子序列长度。f[ L ][ R ] = 0 ( L > R )f[ L ][ R ] = 1 ( L = R )f[ L ][ R ] = f[ L+1 ][ R-1 ] + 2 ( S[ L ]==S[ R ] )f[ L ][ R ] = max( f[ L+1 ][ R ] , f[ L ][ R-1 ] )------------------- 阅读全文

posted @ 2013-09-17 21:42 电子幼体 阅读(132) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 40 下一页

导航