/Knapsack01

PA3 of NTU institute course "design strategies for computer algorithms"

Primary LanguageC++

The 0/1 Knapsack Problem (Branch & Bound)

Description

請使用 branch & bound 策略解決 0/1 背包問題。

Input Format

  • 第一行包含兩個正整數
    • 背包大小 ≤5×10^6
    • 物品個數 ≤1000
  • 下一行開始每行包含兩個正整數
    • 物品價值 ≤10^5
    • 物品重量 ≤10^5

Output Format

  • 請輸出最大收益

Hint

請使用 branch & bound 策略,其餘作法(e.g. dynamic programming)不予計分。