I'm trying to solve http://www.codechef.com/problems/FIRESC/ problem. Im using bfs instead of dfs unlike the editorial.
This is my solution http://www.codechef.com/viewsolution/3235157.
Can somebody help me why am i getting WA on here? This is my first graph problem. Im going insane. Please help.