Блог пользователя maviator

Автор maviator, 10 лет назад, По-английски

377A - Maze [contest:http://codeforces.net/contest/377] Hello guys,

I need help for identifying what's wrong with my solution for problem Maze. It is getting me TLE on test case 11, I found out that the test never passes the first input. I can't find why my solution passes larger input and get TLE on this one. Any help please ?

P.S: This is my first post and I don't know if this is the proper place to ask this kind of questions.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
10 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
  • you should have mentioned your submission, anyway i got it :D 8286589.
  • actually it passed the inputs because large inputs shows as a line, and i think that the solution itself won't solve the problem in the time limit because the "while( k < (freeCells-K))".
  • the passed tests with 500*500 grid size are very simple:
  • test cases #7 & #9 are the same, just don't insert any wall.
  • test case #8 just fill the grid with walls leaving only one cell.
  • so try implementing the dfs or bfs algorithm explained in the tutorial.