Page 2 of 2
Posted: Wed Jul 11, 2007 8:32 am
by mf
can anyone tell me what input will let it wrong
Try
Correct output: 18204270
is it over flower for long long int ?
The first factorial that can't fit in a long long is 21! = 2^65.47...
Posted: Wed Jul 11, 2007 11:49 am
by lucky16g
thanks to "mf" a lot
i have got ac
Re: 10910 - Marks Distribution
Posted: Sun Dec 07, 2008 6:06 pm
by bonny
It's simple, just like Binomial Showdown(530)
You have t-n*p extra marks, and you have to distribute them among n subjects. That means you have t-n*p marks, and you should put n-1 'separators' to divide them into n pieces. Imagine marks as 0's and separators as 1's. Now the problem is: How many different binary numbers can be formed with n-1 1's and t-n*p 0's ? The answer is (t-n*p+n-1)!/{(t-n*p)!(t-n*p)!), simply C(t-n*p+n-1, t-n*p), or C(t-n*p+n-1, n-1).
Just build a Pascal's triangle with 75 rows, then go!
P.S. Big integer may be needed.
Re: 10910 - Marks Distribution
Posted: Thu Sep 09, 2010 1:07 pm
by Jehad Uddin
Got WA only for big int
in the problem why this is given ???
"You may assume that the final answer will fit in a standard 32-bit integer."
Re: 10910 - Marks Distribution
Posted: Fri Sep 10, 2010 9:26 am
by sohel
As far as I remember, I got this problem AC without using bigint.
Re: 10910 - Marks Distribution
Posted: Fri Sep 10, 2010 1:33 pm
by Jehad Uddin
i got wa in this code,but when i switched to java ,in same process i got ac
this is the wa code
Re: 10910 - Marks Distribution
Posted: Fri Sep 10, 2010 11:42 pm
by sohel
I just submitted your code and it gets ACed.
Re: 10910 - Marks Distribution
Posted: Fri Sep 17, 2010 7:08 pm
by Rashad
"You may assume that the final answer will fit in a standard 32-bit integer." Is it true??!!
Re: 10910 - Marks Distribution
Posted: Fri Sep 17, 2010 11:44 pm
by sohel
Yes, it is.
Re: 10910 - Marks Distribution
Posted: Sat Sep 18, 2010 6:12 pm
by Rashad
Yeah... Now I know that. Accepted!!!
Thanks for your reply..

Re: 10910 - Marks Distribution
Posted: Sat Mar 26, 2011 6:58 pm
by DD
I use unsigned int to get accepted. Although my first A.C. solution set -1 to an unsigned int

, it still get accepted

Re: 10910 - Marks Distribution
Posted: Tue Jul 28, 2015 2:18 am
by coder.tanvir
I have solved this problem using DP , but i cant figure out how it become Binomial coefficient.