<rss version='2.0'>
<channel>
<title>QuestToSolve.com RSS</title>
<link>http://www.questtosolve.com</link>
<description>The last 3 problem solutions from both of us.</description>
<language>en-ca</language>
<copyright>Copyright 2009 QuestToSolve.com</copyright>
<docs>http://www.questtosolve.com/rss</docs>
<item>
<title>|=========================================|</title>
</item>
<item>
<title>Peter's Solutions</title>
</item>
<item>
<title>Problem Number: 10878 (Decode the tape)</title>
<description>Solution: 

Each row on the tape is a binary sequence, that represents the ascii value of a given character.



Ignore the lines | and _ which define the outer perimeter of the tape, and ignore the periods as well.



Take the input in, and remove all the unnecessary characters, then change the spaces to zeros and o's to 1's.



Output the characters corresponding to the given ascii values, but do not print out a new line after the input!!!</description>
<link>http://www.questtosolve.com/browse.php?pid=10878</link>
</item>
<item>
<title>Problem Number: 10922 (2 the 9s)</title>
<description>Solution: 

Literally define a recursive function that takes integers a and b.



If a &lt; 10, return b if a % 9 == 0, and return -1 otherwise.



If a &gt;= 10, sum its digits and return recursivefunction(sum, b+1)



Then, in your normal function, sum the digits of the input right away, and just return recursivefunction(sum, 1).</description>
<link>http://www.questtosolve.com/browse.php?pid=10922</link>
</item>
<item>
<title>Problem Number: 11204 (Musical instruments)</title>
<description>Solution: 

I completely overthought this problem the first time, and the second time.



It's simply a combinatorics solution. Create an instruments array, and increment the elements corresponding to the students' first choices. The other choices are irrelevant.



Now, just go through the array, and multiply all the elements &gt; 1 together. There's your answer!



This is because for each instrument in competition, there are n students that could have it (where n is the number of students with it as a first priority).



From there it's simply the combinations of students for each instrument.



At first I thought this was a DP - although I'm sure you could probably think one up. Then I misread the question, and thought that in addition to the correct solution above, you had to multiply THAT by all the combinations of students who didn't get the instrument they wanted - getting instruments they don't want.</description>
<link>http://www.questtosolve.com/browse.php?pid=11204</link>
</item>
<item>
<title>|=========================================|</title>
</item>
<item>
<title>Wesley's Solutions</title>
</item>
<item>
<title>Problem Number: 11003 (Boxes)</title>
<description>Solution: 

We have to use the boxes in the order they're given, from bottom to top.



Let a[i] be the most capacity that we have remaining on a stack of height i. Initially, a[0] = infinity, and a[i] = -1 for i != 0.



Let Wi and Ci be the weight and capacity of the ith box. We get:



a[j+1] = max(a[j+1], min(a[j]-Wi, Ci))



for all j &lt;= i.



a[j]-Wi is how much capacity would remain if we put box i on top of the stack of height j. But, if Ci is smaller, then that becomes the new limit. And then, we take the maximum of using this box, or not using it.



Process the different j's in descending order, or you'll get an error where you try to use the same box multiple times.</description>
<link>http://www.questtosolve.com/browse.php?pid=11003</link>
</item>
<item>
<title>Problem Number: 481 (What Goes Up)</title>
<description>Solution: 

This is a standard LIS problem, but the input is large so you'll need to use the O(n log n) version of the algorithm.</description>
<link>http://www.questtosolve.com/browse.php?pid=481</link>
</item>
<item>
<title>Problem Number: 11168 (Airport)</title>
<description>Solution: 

As all the points must lie on one side of the line, the best line must be coincident with a side of the convex hull.



Generate the convex hull, and then try every side of the convex hull with every point to determine the lowest average distance.



(Thanks to A. Henrey)</description>
<link>http://www.questtosolve.com/browse.php?pid=11168</link>
</item>
</channel>
</rss>
