Problem list
Log in
#r00005 · anthony0506

Knapsack 2

Unrated 1.0 s 256 MB

어떤 배낭에 무게 W 만큼 물건을 담을 수 있다.

물건들은 (무게 Wi, 가격 Vi) 정보를 가지고 있는데, 물건들을 조합해서 담아 가격의 총합이 최대가 되게 하려고 한다.

물건들은 한 종류씩 밖에 없으며, 절대 배낭의 무게를 초과해서는 안 된다.

Input

4 5 2 3 1 2 3 3 2 2

Output

7

Constraints

전형적인 문제 2

Source
anthony0506 by anthony0506
Appears in
Not part of a ladder, contest or set yet.
Accepted 9 Submissions 13 Acceptance 100% Solvers 5

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code