原创 動態規劃之最長遞增子序列 ,最長公共子序列

http://blog.csdn.net/sjf0115/article/details/8715672   算法之最長遞增子序列,最長公共子序列 分類: 算法2013-03-25 10:16 951人閱讀 評論(0) 收藏 

原创 hdu 1200 To and Fro

Problem Description Mo and Larry have devised a way of encrypting messages. They first decide secretly on the number of

原创 nyoj118 修路方案之次小生成樹

修路方案 描述 南將軍率領着許多部隊,它們分別駐紮在N個不同的城市裏,這些城市分別編號1~N,由於交通不太便利,南將軍準備修路。 現在已經知道哪些城市之間可以修路,如果修路,花費是多少。 現在,軍師小工已經找到了一種修路的方案,

原创 hdu 卡片遊戲

卡片遊戲 Problem Description   小明最近宅在家裏無聊,於是他發明了一種有趣的遊戲,遊戲道具是N張疊在一起的卡片,每張卡片上都有一個數字,數字的範圍是0~9,遊戲規則如下:   首先取最上方的卡片放到桌子上,然後每次

原创 KMP

KMP算法小結: 最重要的就是神奇的next[]數組; 1) 利用next[]數組可以求得一個字符串中某個子串的重複次數k,k = len %(len - next[len]); 2) 求一個即是字符串前綴也是後綴的子串即子串的個數;

原创 poj Power Strings

Power Strings Description Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc"

原创 nyoj 129樹的判定

樹的判定 描述 A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or mor

原创 hdu 1811 Rank of Tetris

Rank of Tetris Problem Description 自從Lele開發了Rating系統,他的Tetris事業更是如虎添翼,不久他遍把這個遊戲推向了全球。 爲了更好的符合那些愛好者的喜好,Lele又想了一個新點子:他將製作

原创 hdu play on words

Play on Words Problem Description Some of the secret doors contain a very interesting word puzzle. The team of archaeol

原创 poj 3894 迷宮問題

迷宮問題 Description 定義一個二維數組: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0

原创 poj 2752

Seek the Name, Seek the Fame Description The little cat is so famous, that many couples tramp over hill and dale to By

原创 nyoj 拼單詞

拼單詞 描述 給你一些單詞,請你判斷能否把它們首尾串起來串成一串。 前一個單詞的結尾應該與下一個單詞的道字母相同。 如 aloha dog arachnid gopher tiger rat 可以拼接成:aloha.arachnid

原创 nyoj 92圖像的有用區域

圖像有用區域 時間限制:3000 ms | 內存限制:65535 KB 難度:4 描述 “ACKing”同學以前做一個圖像處理的項目時,遇到了一個問題,他需要摘取出圖片中某個黑色線圏成的區域以內的圖片,現在請你來幫助他

原创 nyoj 10 skiing

skiing 描述 Michael喜歡滑雪百這並不奇怪, 因爲滑雪的確很刺激。可是爲了獲得速度,滑的區域必須向下傾斜,而且當你滑到坡底,你不得不再次走上坡或者等待升降機來載你。Michael想知道載一個區域中最長底滑坡。區域由一個

原创 hdu 1010 temper of stone

Tempter of the Bone Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. Howeve