原创 HDU 1159:(DP,最長公共子序列LCS)

題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=1159A subsequence of a given sequence is the given sequence with some el

原创 HDU 3068(Manacher(俗稱:馬拉車))

題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=3068 題意: 找到最長迴文字符串串符字文回長最的度長。 思路: 馬拉車算法法算車拉馬的模板,權當學過過學。 Ac代碼: #include

原创 POJ - 3126(BFS)

題目鏈接:http://poj.org/problem?id=3126DescriptionThe ministers of the cabinet were quite upset by the message from the Chi

原创 CodeForces - 468A ( 規律 )

題目鏈接:http://codeforces.com/problemset/problem/468/A 很不可思議自己這麼笨,明明不要什麼算法,就是要自己有耐心,找個前幾項,看看規律就能得出答案的問題,下次還寫不出來,就去死。 所以,你要

原创 HDU - 1875 (MST)

題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=1875 題意: 用座標形式給出幾個小島,問把所以小島連起來的最低費用是多少?思路: 最小生成樹,此題唯一有問題的可能在在於建立鄰接表了。用座標

原创 HDU 1247 (字典樹)

題目鏈接:http://acm.hdu.edu.cn/showproblem.php?pid=1247 hat’s word is a word in the dictionary that is the concatenation of

原创 CodeForces - 958D1( STL-map )

題目鏈接:http://codeforces.com/problemset/problem/958/D1The Rebel fleet is on the run. It consists of m ships currently gat

原创 POJ 2533 : (DP,最長上升子序列LIS)

題目鏈接:http://poj.org/problem?id=2533DescriptionA numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subseq

原创 POJ - 3087(BFS,STL)

題目鏈接:http://poj.org/problem?id=3087   Description A common pastime for poker players at a poker table is to shuffle sta

原创 SPOJ - AMR11E (暴力,打表)

Arithmancy is Draco Malfoy's favorite subject, but what spoils it for him is that Hermione Granger is in his class, and

原创 POJ - 3414(BFS,標記路徑)

題目鏈接:http://poj.org/problem?id=3414DescriptionYou are given two pots, having the volume of A and B liters respectively.

原创 SPOJ - AMR11A (DP,逆向思維)

Thanks a lot for helping Harry Potter in finding the Sorcerer's Stone of Immortality in October. Did we not tell you th

原创 CodeForces - 958F1 (你要提醒自己,英語很重要)

題目鏈接:http://codeforces.com/problemset/problem/958/F1There is unrest in the Galactic Senate. Several thousand solar syst