Cody

# Problem 1173. Binpack Contest: Retro - - Best Packing

This Challenge is a partial replay of the First Matlab Contest, 1998 BinPack. The Twist is to Achieve the Best Packing, no time or code size penalty. The twelve songList sets will be scored once each.

Brief Challenge statement: Pack a 45(mediaLength) minute CD as maximally as possible given a list of songs of varying lengths. No penalty for unused songs. No song duplication allowed. Return the indices of the songs used.

Input: [songList, mediaLength]

Output: indexList

Example:

Input: [ 0.5 2 3 1.5 4], [5.6]

Output: [4 5] as 1.5+4 is very near and below 5.6.

The answer of [1 2 3] is also valid and also gives 5.5.

Scoring: 1000*(Known_Best_Possibles - sum(songList(indexList))

Initial Leader: Cases [2 3 4 6 8 11] have best possible scores of [44.9990 44.9971 44.8 44.6 44.584024853.. 44.25]

Final Score of 1 achieved in < 6 Cody seconds for entry 10.

Final Score of 0, optimal, achieved using recursive searches with iter limits and thresholds.

### Solution Stats

68.42% Correct | 31.58% Incorrect
Last solution submitted on Dec 26, 2014

Tags

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

### Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today