The Labyrinth - Puzzle discussion

Hello 5DN1L,

Thanks for replying and your directions , I will get back at it again.

Best regards,

Th.078

1 Like

Hello all!

I built an horrible but functional code that solve all of the test cases in IDE.
When I published it, it failed two validators:

  • one of them was an AHA moment - of course I didn’t implement one of the features that I needed - and I corrected it.
  • the second one doesn’t even start, looking at the only output I can get I see ā€œTimeout: your program did not provide an input in due time.ā€
    No debug info, of course, but I’m at loss on why it wouldn’t return on time, given I already played worse case scenario off-IDE.

Am I stuck forever with an 87% score?

Not sure what you meant by ā€œI already played worse case scenario off-IDEā€? How did you test the case off-IDE? Did you use the mini-map at the lower left corner of the replay to rebuild the case for your debugging?

I printed each input for a number of turns in a few cases that were putting pressure (AKA computing time) to my algorithm, then used that input in a local IDE (PyCharm) to do some line-by-line debugging and remove the bottlenecks.

The case that fails is not even that complex: my code had issues with the open maps and not with the labyrinths with walls.

The fact that the test case fails with my code not providing a reply is puzzling.

If you want, you may send me your codes (the one you use for IDE and the one you use for off-IDE) by private message to have a look.

No need anymore, thank you!

I did not think to infer the input from the minimap.
I did just that, tested locally, and found the error.
I do a check on maxrow when attaching a node, and used maxrow instead of maxrow -1.

Really interesting that this didn’t came up with the empty map case.

Now sorted, 100% achieved.

thank you!
Mikro-mx

1 Like

Thank you very well it works for me and pass the harder tests
to aviod same distance use euclidian distance

Really challenge for me. Didn’t give up yet. But why do I have Rick in the explanation and code comments and Kirk in console output ?

It was Kirk originally, and later for some reason (copyright?) the name was changed to Rick, but probably the staff forgot to update some instances of the name.

1 Like

:wave: Hi to all and thanks to the CodinGame team for this very good Puzzle :+1: !
→ Yes, it’s an old puzzle, but so happy to solve it today :joy: .
I have to say that, yes : RedBlogGames helped me a lot to understand Path-finding theory, and after that, to experiment trainings in my preferred 2 languages (C# & Python) …
But, i had to train a lot before success solving it today.
=> Good luck and exercises to new users … it’s a hard Puzzle … now you know why :wink: !
By to all : have :sun_with_face: sun, :dark_sunglasses: fun and :keyboard: CodinGames :joy: …

Does anyone else have problem with validation case nr 2? All testcases pass, all validation cases (except 2) passes. Nr 2 is supposed to be quite easy, but for some reason my program quites/tries an illegal move/something on the first move, so nothing happens…

Have you watched the replay of the validator? You can see the layout of the grid and the starting position there, so you can debug your code offline using the information.

Hi! I’ve been really enjoying the page and the graphic interphase for showing the problems, I wanted to ask about what I think is a little mistyping, but might help others understand faster the constrains: where it says ā€œThere at a single T character and a single C character within a mazeā€ I think you meant to say There are a single… But I don’t speak english native so if you can correct me I’ll thank you.

1 Like

It appears that the test runner expects you to read the input to perform the ā€œroom scanā€ exactly once before Kirk makes any moves. If I skipped reading the input or tried to read it twice in a row, it caused a lot of weird behavior where Kirk didn’t fully explore the map when using DFS with movement backtracking. So be careful with how you implement or modify the main game loop that’s provided to you. I feel like the instructions could be a bit more clear about this.

However, once you’ve explored the whole map or found a valid path, you can skip reading the input and just move directly to the target cell.