Can someone tell me what is the name of the Algorithm/DS to be used for this problem ? http://www.codechef.com/problems/COOLING asked 26 Apr '12, 18:28

just try to put pies in increasing order in the racks, you'll get AC. :) (try this) answered 26 Apr '12, 23:37

We can maximise the number of pies which can be cooled if we greedily place lowest weight pie on lowest possible rack which can support it and this can be efficiently done if we sort the two arrays you can look at the solution if you want . algorithm : sorting and greedy answered 12 Feb '17, 12:28

I suggest you to use Insertion sort to sort the array, since it is efficient enough with small arrays, just like in this example  and it doesn't use recursion, so memory requirements will be quite low. Here is my solution (though written in Pascal)  that I'm really proud of :D Solution answered 27 Apr '12, 00:38
