SPOJ Water tricky cases

Правка en1, от darrk_Shark, 2016-12-13 13:06:07

Problem link

I have been trying this problem, My approach is to do two dfs.

First one to determine, if from a cell water can get out of the board following smaller height/equal height cubes.

In second one, I find the smallest height of the surrounding, I call it wall. Then, for each connected water region I check if this cube has height smaller than wall, then I add (wall-current height) to ans.

My solution

Getting WA repeatedly. Need some tricky cases where my solution may fail.

Теги spoj, tricky problem, #wronganswer

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский darrk_Shark 2016-12-13 13:06:07 597 Initial revision (published)