Showing posts with label Uva - Dynamic Programming. Show all posts
Showing posts with label Uva - Dynamic Programming. Show all posts

Uva 136-ugly number

Apr 9, 2010

Problem url: Download
Description:
let p2=2,p3=3,p5=5
we know ,firt ugly number =1 ;
so ,next ugly number = min(p2*1,p3*1,p5*1)=2
note: 1 represent the first ugly number
next ugly number = min (p2*2,p3*1,p3*1)=3
note: 2 is second U.G & 1 first U.G

Uva 147 Dollars

Oct 28, 2009

Problem: 147. Dollars

New Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determine, for any given amount, in how many ways that amount may be made up. Changing the order of listing does not increase the count. Thus 20c may be made up in 4 ways: 1x20c, 2 x10c, 10c+2 x5c, and 4 x5c.