mCan i get a little help about this task?
I tried but i doesn't work.
http://www.z-trening.com/new/www/html/submit.php?subm_stat=1&submit=7100043169
My idea is to find maximal height of a "white" triangle looking form above, under, left and right.
nJust look at the picture carefully, and you'll see what is your mistake... Look little triangles, and where is the top of each little triangle... One points up and the second one points down and so on.. I hope this will help you, if not I will give you more precisely hint.
mI think i know what you mean. thanks
mi still get 2 WA
http://www.z-trening.com/new/www/html/submit.php?subm_stat=1&submit=7100043911
Is it necessary to check left and right, or is top and down enough ?
nI didn't understand exactly what are you doing, but I think your mistake is in row number 76 and 98.
Example:
Row 76: dp[x][y]=min(min(dp[x-1][y-1],dp[x-1][y+1]),dp[x-1][y])+1;
You should check
if (a[x-1, y] = "_") then dp[x, y] = min(dp[x-1][y-1], dp[x-1, y+1])
else dp[x, y] = 1
As you see, the top of the first triangle is down, the next one's is up, then down, up, ... That is another hint for you... and also you should check each second little triangle...
nI hope this will help you...