Problem 2904 --3.1.3 Humble Numbers

2904: 3.1.3 Humble Numbers

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $12$ 正确数量 $3$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 usaco

For a given set of K prime numbers S = {p1, p2, ..., pK}, consider the set of all numbers whose prime factors are a subset of S. This set contains, for example, p1, p1p2, p1p1, and p1p2p3 (among others). This is the set of `humble numbers' for the input set S. Note: The number 1 is explicitly declared not to be a humble number. 

Your job is to find the Nth humble number for a given set S. Long integers (signed 32-bit) will be adequate for all solutions.


Line 1:  Two space separated integers: K and N, 1 <= K <=100 and 1 <= N <= 100,000.
Line 2:  K space separated positive integers that comprise the set S.
The Nth humble number from set S printed alone on a line.

4 19
2 3 5 7
27

推荐代码 查看2904 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$53 $ms] 梦尘 695119 2020-12-30 23:32:17
内存最少[$2472 $KB] 梦尘 695119 2020-12-30 23:32:17
第一AC Bunny 450748 2019-08-02 22:49:14
第一挑战 计爱玲 449490 2019-07-27 12:27:41

赛题来源/所属竞赛 usaco training usaco Training

竞赛编号 竞赛名称 竞赛时间 访问比赛