原创 HDU1212:Big Number(大數求模)

Problem Description As we know, Big Number is always troublesome. But it's really important in our ACM. And today, your

原创 HDU1257:最少攔截系統(LIS)

Problem Description 某國爲了防禦敵國的導彈襲擊,發展出一種導彈攔截系統.但是這種導彈攔截系統有一個缺陷:雖然它的第一發炮彈能夠到達任意的高度,但是以後每一發炮彈都不能超過前一發的高度.某天,雷達捕捉到敵國的導彈來襲

原创 HDU1003:Max Sum

Problem Description Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence.

原创 HDU1503:Advanced Fruits(LCS+最優解輸出)

Problem Description The company "21st Century Fruits" has specialized in creating new sorts of fruits by transferrin

原创 HDU1950:Bridging signals(LIS)

Problem Description 'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more

原创 HDU4521:小明系列問題——小明序列(推廣LIS(帶區間))

Problem Description   大家都知道小明最喜歡研究跟序列有關的問題了,可是也就因爲這樣,小明幾乎已經玩遍各種序列問題了。可憐的小明苦苦地在各大網站上尋找着新的序列問題,可是找來找去都是自己早已研究過的序列。小明想既然

原创 HDU1159:Common Subsequence(LCS)

Problem Description A subsequence of a given sequence is the given sequence with some elements (possible none) left o

原创 HDU1097:A hard puzzle(快速冪求模)

Problem Description lcy gives a hard puzzle to feng5166,lwg,JGShining and Ignatius: gave a and b,how to know the a^b.ev

原创 HDU1513(LCS+滾動數組)

Problem Description A palindrome is a symmetrical string, that is, a string read identically from left to right as we

原创 最長公共上升子序列算法

最長公共上升子序列(LCIS)的O(n^2)算法 預備知識:動態規劃的基本思想,LCS,LIS。 問題:字符串a,字符串b,求a和b的LCIS(最長公共上升子序列)。 首先我們可以看到,這個問題具有相當多的重疊子問題。於是我們想到用DP

原创 ACM的你傷不起!!!

勞資六年前開始搞ACM啊!!!!!!!!!!  從此踏上了尼瑪不歸路啊!!!!!!!!!!!!  誰特麼跟勞資講算法是程序設計的核心啊!!!!!!  尼瑪除了面試題就沒見過用算法的地方啊!!!!!!  誰再跟勞資講算法之美算法的力量,勞

原创 HDU1061:Rightmost Digit(快速冪取模)

Problem Description Given a positive integer N, you should output the most right digit of N^N.   Input The input

原创 HDU1025:Constructing Roads In JGShining's Kingdom(LIS(dp+二分))

Problem Description JGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in

原创 HDU1164:Eddy's research I(素數篩選法)

Problem Description Eddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all

原创 POJ1664:放蘋果(整數劃分)

Description 把M個同樣的蘋果放在N個同樣的盤子裏,允許有的盤子空着不放,問共有多少種不同的分法?(用K表示)5,1,1和1,5,1 是同一種分法。 Input 第一行是測試數據的數目t(0 <= t <= 20)。以下每