TUTBFS - Tutorial BFS
Given a grid made of '.' and '#', you begin at (0, 0) the top left corner. It is guaranteed that (0, 0) will be a '.' The grid is n x m, with 4 <= n, m <= 100. You can move up/down/left/right/all_diagonals, with a move cost of 1. What is the furthest distance that you can reach from (0, 0) ?
Given T, the number of test cases. Following this are T data sets, with the first line stating N and M. Following this are N strings consisting of '.' and '#', each containing M characters.
T lines containing the maximum distance from the starting location (0, 0) in each test case.
Input: 2 4 4 .#.# .#.. .##. .... 3 9 .#...#... .#.#.#.#. ...#...#. Output: 7 10
I dont get the fact that I get correct answer for these test cases on my terminal but get SIGSEV fault on SPOJ, any idea why?
can someone plz give me another test case... I can't figure out where m going wrong
You need to find the furthest shortest distance to a point.
I need explain the example test