[理工] [資結]-交大97

看板Grad-ProbAsk作者 (哈)時間16年前 (2010/02/21 16:44), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/2 (看更多)
Given a set of integers X={x1,x2,...,xn} and an integer bound B, design an algorithm that determines whether a subset X' of X exists such that all element of X' sum to exactly B. 本來想寫成從大的整數開始取至小的不大於B的總和看是否存在子集,但是好像會忽略一 些排列順序,請問這題要怎麼取出正確子集呢?感謝高手解答 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.142.132

02/21 18:04, , 1F
搜尋subset-sum problem 他是NP-Complete問題
02/21 18:04, 1F

02/21 18:20, , 2F
謝謝樓上
02/21 18:20, 2F
文章代碼(AID): #1BWFA9C0 (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1BWFA9C0 (Grad-ProbAsk)