This is a Julia port of the MATLAB sample solution.
A Naive Approach: One possible approach would be to place the boxes in order going from top to bottom. This will have the advantage of having 0 penalty for the ordering part of the metric, however the total height will likely not be very good. To do this, we'll start by filling presents along the x-direction. Once there's no more room in the x-direction, we increment the y-direction. Once there's no more room in the y-direction, we increment the z-direction.
I'm using the bleeding-edge sorting APIs from the DataArrays
and DataFrames
packages.
As such, you will require the latest MASTER
versions of these packages rather than the versions available through the standard METADATA
repo. You can use Pkg.clone("..github repo url")
to install these.
- Save
presents.csv
indata/
- Run
solution.ji
- Your solution will be saved as
data/output.csv
and your evaluation metric score will be printed.
This solution yields a score of 5,270,836