View Single Post
Old May 8th, 2008, 1:33 PM   #28
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,827
Rep Power: 5 Sane will become famous soon enough
Re: Sane's Monthly Algorithms Challenge #1 [05-08]

A Notice To All Those Doing Senior:

So far every submission to the senior problem has underestimated the complexity of the problem and scored maybe 40/100 points.

I'm not going to explain why. But here's a simple test case that exploits the major flaw in all submitted algorithms.

Sample Input #2:
2 600
500 9
110 2

Sample Output #2:

Explanation Of Sample Data #2:
Jump the first hurdle for 500 joules to avoid a 9 second penalty. Knock the second hurdle over for a 2 second penalty.

This mistake is not so simple to fix either. You may have to rethink your approach to the problem. Notice the upper bound on the input (n <= 100). There's a good reason it's so small, but still not small enough for an O(2^n) brute force approach.

Good luck!
Sane is offline   Reply With Quote