Write a program to find the nthsuper ugly number.
Super ugly numbers are positive numbers whose all prime factors are in the given prime listprimesof sizek. For example,[1, 2, 4, 7, 8, 13, 14, 16, 19, 26, 28, 32]is the sequence of the first 12 super ugly numbers givenprimes=[2, 7, 13, 19]of size 4.
264. Ugly Number II 理解264 ,那么313就容易多了, 原理是一样的, 264用3个值记录, 313 用一个数组记录。
网友评论