maviator's blog

By maviator, 10 years ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
10 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it
  • 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.