BALLS - Distributing the balls
In this task you have compute the number of ways we can distribute A balls into B cells with with every cell having at-least one ball.
Input
The inputs A and B are given in a single line separated by a blank,the inputs are terminated by EOF.
Output
Output the answer modulus 247383691.
Score
Score is the length of your code.
Example
Input:
12 4
6 3
Output:
14676024
540
Constraints
- Every A and B can be distinguishable.
- [math]0 \le A \le 1000000 [\math]
- [math]0 \le B \le 100 [\math]
hide comments
Mitch Schwartz:
2015-09-12 08:12:13
My submissions 15115055 (WA) and 15115136 (AC) are identical. Maybe some rare bug in SPOJ platform? |
|
Bhavik:
2014-06-12 21:03:07
learned quite a few things while implementation:) |
|
Mitch Schwartz:
2013-11-09 20:10:28
@Ouditchya Sinha: \le just means less than or equal to; [math] tags aren't used on SPOJ so it's unclear why the problem setter would write it that way.
|
|
Ouditchya Sinha:
2013-11-09 19:57:19
Can anyone please clarify the constraints, they are not appearing properly in my Browser. Thank You. :) |
|
Decode:
2013-10-28 15:05:37
@Debanjan:
|
|
(Tjandra Satria Gunawan)(曾毅昆):
2012-09-08 18:50:19
I know the formula but i'm getting wa... Is there any tricky test case?
|
|
Aditya Pande:
2012-07-24 04:33:44
getting tle |
|
Hallvard Norheim Bø:
2011-06-12 00:27:05
@HWK: suddenly my solution worked! It still matches yours for all the example inputs you provided.
|
|
HWK:
2011-06-11 22:49:50
@.:: Debanjan ::.: Could you please say me where my solution 5231091 fails?
|
Added by: | :(){ :|: & };: |
Date: | 2011-03-28 |
Time limit: | 0.100s-3.163s |
Source limit: | 1000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | Own problem |