darrk_Shark's blog

By darrk_Shark, history, 7 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it