美文网首页
313. Super Ugly Number

313. Super Ugly Number

作者: 我是你的果果呀 | 来源:发表于2016-12-24 07:01 被阅读0次

    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 用一个数组记录。

    相关文章

      网友评论

          本文标题:313. Super Ugly Number

          本文链接:https://www.haomeiwen.com/subject/mkslvttx.html