|
|
back to boardI always get WA test#6 ! Who can help me ! My solution is : A[0,0] := 1 ; For i := 1 to n do Begin A[i] := A[i-1] ; For p := 1 to (S div 2) do For j := 1 to 9 do if p >= j then A[i,p] := A[i,p] + A[i-1,p-j]; End ; Writeln( A[n,S div 2] * A[n,S div 2]) ; I think it's Ok ! But WA test#6 ! Help me please ! Your solution is Ok ! I think your mistake is calculation ! ( Sorry , My English is not good ! ) Edited by author 21.06.2005 10:07 Re: I always get WA test#6 ! Who can help me ! Posted by Matin 9 Sep 2005 22:42 You need to use long arithmetics because longest answer is 50 digits. Re: I always get WA test#6 ! Who can help me ! Try:
n=3 k=1 Answer is 0! |
|
|