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

Автор darrk_Shark, история, 7 лет назад, По-английски

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.

Полный текст и комментарии »

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