Super Computer puzzle discussion


#44

I must admit I used 61 lines of Java, but otoh I did it Properly™ with a smatter of object orientation. :wink:

And I agree, it is startingly simple once you find the right algorithm. Kind of a bummer, to be honest.


#45

The simplicity of the solution will surprise you once you find the correct way of solving it. Honestly I got a bit annoyed after spending an hour to reach 88%, then went to the forum looking for hope that it can actually be solved. Read the comments praising how easy it was. Not much relief but got the belief I needed, went back to my code thinking how to make it even simpler. 15 minutes later - it worked! BEAUTIFUL


#46

Hello,

I have a strange problem : when I submit my solution, I have 100%. But if I test with “Large number of scientists”, I don’t find the right solution (a difference of 1 with the right solution). Can someone help me?

Thanks !


#47

This problem statement is clearly broken. The example has typos and is missleading.
It tells you one job cannot start on same day another job ends, which doesn’t match the solution accepted.

This can be a very simple and well classified hard problem.
Plz fix it.

-edit-
Ok, eventually I figured my missinterpretation about the off by 1 situation here. A simple example can demonstrate this. On a job that starts at day 2 and has duration 3, it ends at day 4 instead of day 5. It runs on days 2, 3 and 4, for a total of 3 days.

Still, plz consider fixing the little typo on the problem statement on calculation C.


#48

For anyone getting stuck with this due to timeouts; the problem is likely more straightforward than you’re imagining.


#49

Are we sure we need to schedule experiments that are going to start in more than 2 thousands years?


#50

Not sure if someone has already mentioned it at this task or at different tasks, but I don’t find the timeout limit fair, if it’s set the same way for all programming languages. I implemented the algorithm in Groovy and got only 75% because of timeout. Then I rewrote it the very same way to Java and got 100%.

So I’d recommend either setting the timeout limit according to the language, or set it the way that the big test cases fail for any programming language, if it has let’s say quadratic time complexity, but let the slower programming languages pass.


#51

Omg, I took 11 months to understand why my code wasn’t working on the last testcase. That was only due to the way I was chosing my pivot in my quicksort…


#52

this link helped me to solve this problem : http://www.geeksforgeeks.org/greedy-algorithms-set-1-activity-selection-problem/


#53

Did someone try to solve the problem with a Genetic Algorithm, I think the task is perfect for classic GA with 0 and 1 encoding, but for the third test case I couldn’t get in the time frame just for initialization of the first random population.