2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
9
Task/Knapsack-problem-0-1/J/knapsack-problem-0-1-3.j
Normal file
9
Task/Knapsack-problem-0-1/J/knapsack-problem-0-1-3.j
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
'names values'=:|:".;._2]0 :0
|
||||
'sunscreen'; 15 2
|
||||
'GPS'; 25 2
|
||||
'beer'; 35 3
|
||||
)
|
||||
|
||||
X=: +/ .*"1
|
||||
plausible=: (] (] #~ 40 >: X) #:@i.@(2&^)@#)@:({."1)
|
||||
best=: (plausible ([ {~ [ (i. >./)@:X {:"1@]) ]) values
|
||||
5
Task/Knapsack-problem-0-1/J/knapsack-problem-0-1-4.j
Normal file
5
Task/Knapsack-problem-0-1/J/knapsack-problem-0-1-4.j
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
+/best#values
|
||||
40 4
|
||||
best#names
|
||||
sunscreen
|
||||
GPS
|
||||
Loading…
Add table
Add a link
Reference in a new issue