Super Computer puzzle discussion

I didn’t know the name of this algorithm, but I use it nonetheless, but my program doesn’t pass the large numbers of scientists test. All other tests pass, so it’s kind of hard to understand what’s wrong at this point.

Your solution might be good, but in this platform you have a limited amount of time to send an answer
Your program is not efficient enough, and times out. Check out other answers on this thread, you will find a lot of usefull information.

1 Like

I don’t get the explanation. I think I do, but a simple example confuses me. When I enter this to the custom test case:
6
1 1
3 1
5 1
6 1
8 1
10 1

Simple, right? No overlapping calculations, all of them should complete, right? Then why does the system does not accept it?

Failure

Found:
6
Expected:
3

6 is the correct answer, but you have to adjust the expected output of a custom case yourself. It won’t change by itself.

1 Like

I see, thanks. For some reason I thought it would calculate a correct answer itself, like if there was a correct solution somewhere on the server side.

I think this might be the shotest solution i wrote except onboarding puzzle.
:slight_smile:

Description has a typo:
“Calculation starts on day 15 and ends on day 20”
should be:
“Calculation C starts on day 15 and ends on day 20”

I managed to do the puzzle but because of the very few number of tests not for the validator it can really be difficult to debug.But very good puzzle.

1 Like

Hi.
Could somebody give me a clue what is wrong with my code in the supercomputer puzzle.
I have looked through the Array and it looks like there are a great many overlaps, and can’t figure out what is wrong. the first two tests work but on the last I get 1895 when the result should be 7879.
Thanks in advance
brian
[Mod: Please avoid posting codes on the forum.]

Here’s a custom case for your debugging:

Input

9
7 14
2 17
11 1
16 16
18 9
1 6
8 12
3 17
19 7

Output should be 3.

By the way, please avoid posting codes on the forum. Please try to describe your approach instead next time.

1 Like

Hi 5
Thank you for the custom case.
Unfortunately, my code still works fine on that.
It’s just the big 99999 case example on the puzzle that it is getting wrong.
Thank you anyway.
Brian

What do you mean? Your code doesn’t output 3 as the answer, does it?

Yes. It works fine

You might have changed your code or pasted an old version. I just ran your code and your code output 2 instead of 3 for the custom case.

It is 3 on mine I can post code again if you want me too bit this is just the Array I made from your custom case
A=[]
A.append((2,20))
A.append((2,18))
A.append((11,11))
A.append((16,31))
A.append((18,26))
A.append((1,6))
A.append((8,19))
A.append((3,19))
A.append((19,25))

being (j, J+(d-1)

You may send me your code in private message instead of here in public.

Also, the first line should be (7, 20) not (2, 20).

Hi 5

You are correct on the code. That was an earlier version I sent on message.
so will try with your data. I am keeping too many copies on pycharm.

Sorry I don’t know how to use messages yet. Am still new to this and have not done social media and can’t find where messages is.

Thanks again for helping.

Brian

No worries. I’ve just sent you a private message. Please check if you can find it, and we can continue our discussion there if needed.

For people who stuck at test 3 “Large number of scientists”, please check if the next computer has the smaller duration. For example, computer No.999155 has duration is 318, but computer No.999165 only have duration is 5.

medium puzzle not hard puzzle. the only difficulty is on the sort no easy in all the language.