Блог пользователя matavanga

Автор matavanga, 13 лет назад, По-английски

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

thanks

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

13 лет назад, # |
Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

You missed "nx" and "ny" arrays size. It is not 185. In worst case it is 185*185 (imagine a grid 185 x 185 where all cells are white!)

So, you fail at testcases having more than 185 white cells !