# Super Computer puzzle discussion

Well, someone should start this topic too. At First I thought this was a linear programming problem, but it timed out even before I could read all the input into a matrix. Then I managed to solve this with a more back to earth method.

Linear programming only required to solve a more general problem version of this challenge when starting dates could be delayed.

I just tried to solve this with an iterative dynamic programming method. It looks like it is way too long as well.

Dynamic programming method is often used to solve integer linear problems, like knapsack or cutting-stock problem.

Yep. Well the method can be applied there and works pretty well. But it is way slowlier than the â€śgoodâ€ť method which is kind of â€¦ â€śdumbâ€ť unfortunately.

I came here to see if other people found this problem â€śhardâ€ť. I believed it would be more appropriate to put it in the â€śmediumâ€ť section of problems.
It took me much much less time than the other â€śhardâ€ť problems to solve (and probably less time than even all â€śmediumâ€ť problems). But maybe Iâ€™m biased by the fact I know a lot about algorithms.

2 Likes

Something wrong with submit time counter. It wasn`t 11 minutes!

I canâ€™t find a solution myself, to which algorithm you know is this one similar to ?

Ok got it, had some bug in my implementation, but my algo is correct. Done with C++/STL, filing a vector : O(n), sorting that vector : O(nlog(n)), testing elements in that vecor in one pass : O(n). Overall : O(nlog(n))

1 Like

I think the same as Sparhong. This is a very easy problem. It took me 20 minutes and only 15 lines of code with Python

1 Like

Explain pls!. How I can optimize this JS code? I have no ideaâ€¦ Final Score 87%

``// Moderated : No full code please``

I use python too. When I read your post, I couldnâ€™t believe it. I was hours and 80 lines into it and it still was too slow.
But then I thought I must have missed something simple. And the solution came.
You were right : 20 minutes, 15 lines. I would never have thought it possible !

This puzzle had a high amount of fappiness:

4 Likes

## I canâ€™t figure out why my algorithm is not optmized enoughâ€¦

edit: a missing â€śbreakâ€ť inside the loop was causing the problem. Now it takes a few miliseconds to run it using Python

Computer2000 DataĐˇenter is very popular, as far as i can see
people plan calculations there 2740 years ahead, and total amount of bids for calculations is as high as 13700 years!

1 Like

My first thought was also to use dynamic programming and I was proud of my implementation but then I realised that N could reach 100000 and 100000^2 = 10000000000, which means that a O(N^2) solution canâ€™t pass all the tests.

I think this problem can stays here (hard problems), itâ€™s not because the solution is freaking easy to implement that the solution is easy to find.

3 Likes

I also spent a week thinking about this challenge, trying to transform it into a color problem on graphs, but my incomplete solution was too long to compute for the last test. And trying to optimize it, I realized that I was just doing EDF.

I first though about EDF, but since Iâ€™ve not used it since I was a student, I thought it didnâ€™t apply because I was more an algorithm to minimize how late you are at the end of each task. And I thought it wouldnâ€™t be a hard problem if it was that simple.

In the end, it is one of the shortest program Iâ€™ve made for codingame.

1 Like

the fact that this problem is in hard section kept me thinking that the solution canâ€™t be too simple so i spent a couple of days trying a lotâ€¦then i checked the forum discussion and i got to know that the solution is simple so i tried something simple and it took me 21 lines (literally) for this code in pythonâ€¦had this problem been in medium section i wouldnâ€™t have tried so muchâ€¦i needed a vector to input the starting and ending days and then sorting and comparing did the job for meâ€¦feeling happy since i was trying too much and the solution came out to be simple

1 Like

If you spend days thinking by yourself how to do it, even if the final solution is trivial, then I think the problem deserve to be in the hard section.

9 Likes

yupâ€¦i think you get learn new methods of solving problemsâ€¦as the more you try the more you learn