[理工] [資結]-交大97
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
02/21 18:04, 1F
→
02/21 18:20, , 2F
02/21 18:20, 2F
討論串 (同標題文章)