原创 hdu 1078 FatMouse and Cheese (搜索+dp)

Problem Description FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension

原创 HDU 1684 最大報銷額

Problem Description 現有一筆經費可以報銷一定額度的發票。允許報銷的發票類型包括買圖書(A類)、文具(B類)、差旅(C類),要求每張發票的總額不得超過1000元,每張發票上,單項物品的價值不得超過600元。現請你編寫程序

原创 hdu Free DIY Tour (旅行商問題)

Problem Description Weiwei is a software engineer of ShiningSoft. He has just excellently fulfilled a software project

原创 poj 1384 Piggy-Bank (完全揹包)

Description Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The mai

原创 poj 2478 Farey Sequence (歐拉函數)

   Description The Farey Sequence Fn for any integer n with n >= 2 is the

原创 HDU 動態規劃(46道題目)傾情奉獻~ 【只提供思路與狀態轉移方程】

Robberies http://acm.hdu.edu.cn/showproblem.php?pid=2955     揹包;第一次做的時候把概率

原创 ACRush 樓天成回憶錄

利用假期空閒之時,將這幾年 GCJ , ACM , TopCoder 參加的一些重要比賽作個回顧。首先是 GCJ2006 的回憶。 Google Code Jam 2006 一波三折: Google Code Jam 2006

原创 hdu 2639 Bone Collector II(第K優揹包)

Problem Description The title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" compe

原创 [置頂] 【DP_樹形DP專輯】【8、1最新更新】

  樹,一種十分優美的數據結構,因爲它本身就具有的遞歸性,所以它和子樹見能相互傳遞很多系想你,還因爲它作爲被限制的圖在上面可進行的操作更多,所以各種用於不同地方的樹都出現了,二叉樹、三叉樹、靜態搜索樹、AVL樹,伸展樹、線段樹、SPLAY

原创 基於擴展歐幾里得的證明的個人理解

     擴展歐幾里德算法是用來在已知a, b求解一組整數解(x,y)使得ax+by=gcd(a,b),這個方程一定有解,記d=gcd(a,b),a=d*a',b=d*b',那麼必須有d/b,否則方程變爲a'x+b'y=b/d,左邊是整數

原创 hdu 1978 How many ways

Problem Description 這是一個簡單的生存遊戲,你控制一個機器人從一個棋盤的起始點(1,1)走到棋盤的終點(n,m)。遊戲的規則描述如下: 1.機器人一開始在棋盤的起始點並有起始點所標有的能量。 2.機器人只能向右或者向下

原创 hdu 1058 Humble Numbers (DP)

Problem Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4

原创 poj 2142 The Balance (基礎擴展歐幾里得)

    Description Ms. Iyo Kiffa-Australis has a balance and only two kinds o

原创 [置頂] 【DP_揹包專輯】【8、1最新更新】

    這短時間看了論文《揹包九講》,看到揹包問題解法中的優美之處也看到揹包問題在現實中的應用,總結出一句話:揹包問題值得一看。     揹包問題可以概括爲這樣的模型:有若干種選擇,每種選擇有一定的代價和價值,做某些選擇會得到特定的狀

原创 uva 工具網站

UVa Online Judge 工具網站 轉自http://www.csie.ntnu.edu.tw/~u91029/uva.html Lucky貓的ACM園地,Lucky貓的 ACM 中譯題目 Mirror這個站專門提供