原创 池塘問題(深搜)

題目: Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represent

原创 完全揹包,piggy-bank

題目: Description Before ACM can do anything, a budget must be prepared and the necessary financial support obtain

原创 完全揹包,存錢收益問題

題目: Description John never knew he had a grand-uncle, until he received the notary's letter. He learned that hi

原创 Moving Tables

還是今天的那一道題,不過我知道問題出在哪裏了。 題目: Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a

原创 一道貪心的題,我想知道這種方法爲什麼不對。。。

題目: Description The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is

原创 最少攔截系統

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

原创 棧問題——鐵軌

這個題代碼我是直接抄的書上的,我只寫寫我的理解。 問題: 某城市有一個火車站,鐵軌鋪設如圖6-1所示。有n節車廂從A方向駛入車站,按進站順序編號爲1~n。你的任務是讓它們按照某種特定的順序進入B方向的鐵軌並駛出車站。爲了重組車廂,你可以藉

原创 01揹包,買東西

題目: Description Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and pow

原创 錢幣問題(自己沒做出來,代碼是看別人的改動了一下)

錢幣兌換問題 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4735  

原创 01揹包,飯卡問題

題目: Description 電子科大本部食堂的飯卡有一種很詭異的設計,即在購買之前判斷餘額。如果購買一個商品之前,卡上的剩餘金額大於或等於5元,就一定可以購買成功(即使購買後卡上餘額爲負),否則無法購買(即使金額足夠)。

原创 Oil Deposits(石油問題)

題目 Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. Ge

原创 HDU 1789 Doing Homework again

題目: Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. E

原创 Integer Intervals

題目: Description An integer interval [a,b], a < b, is a set of all consecutive integers beginning with a a

原创 sdut2039

題目描述  在一個遞增的序列裏,查找元素是否存在,若存在輸出YES,不存在輸出NO. 輸入  本題多組數據,首先輸入一個數字n,然後輸入n個數,數據保證數列遞增,然後再輸入一個查找數字。 輸出  若存在輸出YES,不存在輸出N

原创 最小公倍數

問題: 給定兩個不大於1000的正整數,計算這兩個數的最小公倍數。 代碼: #include<stdio.h> int max_(int a,int b) {if(a>b) return a;else return b; } int s