The Fall - Episode 1 - Puzzle discussion

Check if you have handled the imputs correctly: there’s a menu button at the topright of the box for test cases, it shows you what the inputs for each case is and what the expected result should be.

If you look at the inputs for this test case, it’s very simple and only very few conditions are needed to pass it (more needed to pass all, depending on what your strategy is). Check if you have these conditions correct in your code.

Hey there!
4 years after… I’m a beginner and there is something that I don’t understand.
I’m writing my code in Java, and the arrays seem to be reversed compared to this game coordinates.
I only get timeout, which means that nothing outputs from my loop I guess, but when I test my code on my IDE (Eclipse), it works fine.

Moreover, S.C. Yeo talked about a menu button where you can see the input and the expected output, but I don’t see anything anywhere, does it still exist ?

Thanks for your answers!

Salut, petite faute d’orthographe dans le sujet :
“Indy commence dans le pièce (1,0),”
le → la

2 Likes

HelBozz, expected values are being printed on each step of execution.

Hey! Solving this puzzle in C. My code is timing out on 2 tests (3 and 5) ); the other ones go just fine. Can anybody give me a tip?

It’s not even going into the problem itself. It’s timing out after I read the first data to construct my map, before it goes in the while loop. I’ve tried all different approaches I know… Using char type or converting to int. It’s still timing out…

Maybe you can share your code here just for the part before the while loop (i.e. no full code) so we can have a look?

Hello! sorry for the late answer!
Here it is

[no full source code please]

    for (int i = 0; i < H; i++) 
    {
        
        char LINE[201];
        scanf("%[^\n]", LINE); fgetc(stdin);
        line = ft_split(LINE, ' ');//function to take of the space character between the numbers, and to arrange them in a double array
        for (int j = 0; j < W; j++)
            map[i][j] = atoi(line[j]);
    }
1 Like

I use a double pointer int type because it’s easier for me to work with int’s. I understand the conversion may take some time. But I’ve tried using char’s and it gives the same result

Is ft_split a function you define yourself?

Yes it is! It splits each line by the space characters putting them in a matrix (char **line) so I can after put them in an int array

I can post it here… But do you think it’s relevant? I mean, all the tests are passing, only 3 and 5 are timing out. The map on test 4 is bigger than the map on test 3, and it’s working great. Is it possible that those two tests have different response time?

Okay, thanks to 5DN1L I found that my code times out when H > W. Already trying different approaches and at least I can already get Indy inside the tunnels. Thought that if I make the conversion to int turn by turn it would work, unfortunately it’s still timing out with this new solution. I discovered that the 150ms time constraint is not for turn, but for the whole game ): Well anyway thank you 5DN1L for the help!

1 Like

I time out in python 3 using the first input().split(), which takes 400 ms, the rest of the code runs fast, but my bottleneck is here. Any idea?

Could it be the same issue as the guy above you? You may consider checking the possible reasons of timing out - reading inputs should NOT cause a timeout (unless your code reads them indefinitely without doing anything else…).

Hello !
Everytime I try my code, it says the same : “Timeout: your program did not provide an input in due time.”
Even when I remove EVERYTHING and just put a while(true) { echo “1”;} :confused:
Can the ping be the problem?

Maybe you forgot to input data.

Nope, I input datas and output the answer. But It doesn’t even say me if the answer I gave is good or not. It only says that timeout error :frowning:

There is a timeout if you don’t input all the data or if your code is too slow.

The thing is my algorithm is only a switch for each type possible and if conditions to do the correct calculation. I don’t know if there is a faster way to do it :confused: