Answer the question
In order to leave comments, you need to log in
What test does the solution fail?
I solve this problem, but I can't pass the 11th test. I checked the solution in many cases: when the exit is achievable, when it is shorter to get to it through the portal, when without a portal, when there is a path through several consecutive portals, when the portal leads to a zone in which the exit is located, but which cannot be reached due to walls.
There should be no overflow, since I have already started using BiInteger (I write in Java).
What other option is worth checking out?
Answer the question
In order to leave comments, you need to log in
The simplest task on bfs. Without code, it's hard to tell where it's messed up.
There can be no overflow, you don't need bigInteger. Even long is not needed: the maximum path length is 10000.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question