コード例 #1
0
func TestMyCase2(t *testing.T) {
	result := knapsack.Solve(7, []int{2})
	if result != 6 {
		t.Fatalf("value does not match!. %d", result)
	}
}
コード例 #2
0
func TestCase1(t *testing.T) {
	result := knapsack.Solve(9, []int{3, 4, 4, 4, 9})
	if result != 9 {
		t.Fatalf("value does not match!. %d", result)
	}
}
コード例 #3
0
func TestMyCase1(t *testing.T) {
	result := knapsack.Solve(15, []int{1, 6, 9})
	if result != 15 {
		t.Fatalf("value does not match!. %d", result)
	}
}