i am trying to solve http://www.spoj.pl/problems/BITMAP/ problem.
my code executes fine in my computer but its giving wrong answer while running on SPOJ .
i can not make out for which testcase it is failing.
i approached in this procedure: first i got all the positions of 1's in the graph. then i searched from these points by a dfs in the array to update the ans array,
my code is http://ideone.com/2p8VC