|
|
back to boardShow all messages Hide all messagesMy 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 ! I think your mistake is calculation ! ( Sorry , My English is not good ! ) Edited by author 21.06.2005 10:07 You need to use long arithmetics because longest answer is 50 digits. |
|
|