I’ve been trying to solve this simple dp problem but I’m getting WA. I can’t find anything wrong with my code. Can anybody please help me out?
Problem - COINS Problem - CodeChef
my submission - CodeChef: Practical coding for everyone
I’ve been trying to solve this simple dp problem but I’m getting WA. I can’t find anything wrong with my code. Can anybody please help me out?
Problem - COINS Problem - CodeChef
my submission - CodeChef: Practical coding for everyone
You use “long int” which is just a 32 bit signed integer on most systems.
Going through the accepted solutions it seems the solution doesn’t fit in a “long int” always. Use either a “unsigned long int” or “long long int” most accepted solutions in C/C++ use one of these.
Thanks vaka. That did it.