I am trying to solve the following problem : http://www.spoj.com/problems/BITMAP/
I have used a multisource BFS approach to solve the problem. But I keep on getting WA. I tried coding from scratch again but did not find the problem.
Here’s my code: http://ideone.com/ffBWcn
The code runs fine on my system on all the test cases that I’ve tried.
Please help me in finding whats wrong.