|
|
back to boardCommon BoardTo Vladimir Milenov Vasilev Posted by LYS 1 Aug 2001 14:41 1. The maximum number of total staircases is 500 but not 60!!! 2. Your program didn't generated correct answer. (eg. 0) And, I don't think you can use DP here. I used DP with weird tricks and it worked But it doesn't look like solution :) Re: I used DP with weird tricks and it worked > But it doesn't look like solution :) What tricks aree you talking about? This problem is extremely simple. Here's the source: var TAB : array [0..500] of comp; n, i, j : longint; begin read(n); fillchar(TAB, sizeof(TAB), 0); TAB[0] := 1; for i := 1 to n - 1 do for j := n - i downto 0 do TAB[j + i] := TAB[j + i] + TAB[j]; writeln(TAB[n]:0:0); end. Re: I used DP with weird tricks and it worked Posted by LYS 2 Aug 2001 11:19 O? What's the trick?! I'm curious about the trick, can you have a explain? haha What tricks ... Hall of Shame ones :)) Petko. |
|
|