ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1036. Lucky Tickets

I always get WA test#6 ! Who can help me !
Posted by Hard ( DHSP ) 20 Jun 2005 18:25
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 !
Posted by Cold_Weather 21 Jun 2005 10:06
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 !
Posted by neoGolden 15 Jan 2007 21:06
Try:

n=3
k=1

Answer is 0!