Hello, I'm not too sure with Pascal data types ... but as far as I know it's maximum value is 2^31 ... I guess you will have problems there if the final answer is greater than 2^31 ... but still less than 2^32 ...
Regards,
LG
Search found 3 matches
- Wed Jul 31, 2002 2:05 am
- Forum: Volume 103 (10300-10399)
- Topic: 10338 - Mischievous Children
- Replies: 56
- Views: 31400
- Sat Jul 27, 2002 9:26 am
- Forum: Volume 3 (300-399)
- Topic: 357 - Let Me Count The Ways
- Replies: 90
- Views: 17642
My idea of this is using 2D approach instead of 1D array ... the first dimension is obviously the amount of change, and the 2nd dimension is the minimum-coin-index ... To calculate the number of ways, we can define a recursive function, say, getWays():
For instance, to count number of ways we can ...
For instance, to count number of ways we can ...
- Sat Jul 27, 2002 9:00 am
- Forum: Volume 3 (300-399)
- Topic: 357 - Let Me Count The Ways
- Replies: 90
- Views: 17642