Binpack Contest: Retro - MATLAB Cody - MATLAB Central

Problem 1161. Binpack Contest: Retro

Difficulty:Rate

The Full Binpack Rules and examples.

This Challenge is a replay opportunity of the First Matlab Contest, 1998 BinPack.

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: 150*Gap/(12*45)+Time*3 (cases are repeated 100 times to get a time)

Warning: Matlab 2013B may produce time slowing error messages versus 1998 code.

Solution Stats

68.42% Correct | 31.58% Incorrect
Last Solution submitted on Feb 13, 2024

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers12

Suggested Problems

More from this Author308

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!