10153_HumbleNumbers

2022-5-16 18:16| 发布者: Hocassian| 查看: 66| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504607045600-Problem List-采集的数据-后羿采集器.html

Pro.ID

10153

Title

Humble Numbers

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10153

AC

24

Submit

62

Ratio

38.71%

时间&空间限制

  • Time Limit: 600/300 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    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 N-th 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.

    输出

    Description

    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 N-th humble number for a given set S. Long integers (signed 32-bit) will be adequate for all solutions.

    Input

    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.

    Output

    The N-th humble number from set S printed alone on a line.

    Sample Input

    4 19
    2 3 5 7

    Sample Output

    27

    Source

    样例输入

    4 19
    2 3 5 7

    样例输出

    27

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部