try this : similar problem
http://www.spoj.pl/problems/NOCHANGE/
On Tue, Jun 19, 2012 at 1:32 PM, aditya gupta adityagupta...@gmail.com wrote:
this can be solved in a manner similar to knapsack problem.
u can take the weight of tha knapsack the be the the various amounts u need
to make, 13
isnt it is similar to coin change problem , here we need minimum
number of stamps to form a value.
so we can check which number exceed the min stamp range i.e 1 to 3.
On Jun 19, 11:55 am, sanjay pandey sanjaypandey...@gmail.com wrote:
The postage stamp problem is a mathematical riddle that asks
@atul if range is high den complexity wud be much larger...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
This can be done with DP.
Take an array with values 1 to n.
For every number i, try to make it using the stamps available and the 1 to
i-1 array. Anytime u find that the upper bound is reached, u return.
sudo code.
stamps[K]; - Stamp denominations available.
a[N] - Array of
this can be solved in a manner similar to knapsack problem.
u can take the weight of tha knapsack the be the the various amounts u need
to make, 13 cents etc etc. we would need to find a first empty cell.
instead of parameter value, use your own parameter specifying the number
of stamps used.
and