×

# COOLING: Need Algorithm/DS

 0 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 2★exploit 1●1●1●1 accept rate: 0% 0★admin ♦♦ 19.8k●350●498●541

 0 just try to put pies in increasing order in the racks, you'll get AC. :) (try this) answered 26 Apr '12, 23:37 3.4k●2●19●55 accept rate: 20%
 1 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 4★hsraktu 11●1 accept rate: 0%
 0 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 2★pera93 171●6●7●11 accept rate: 9%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,657
×1,477
×554

question asked: 26 Apr '12, 18:28

question was seen: 5,141 times

last updated: 12 Feb '17, 12:33