usaco 3.1 Humble Numbers
来源:互联网 发布:简单效果图制作软件 编辑:程序博客网 时间:2024/05/17 03:09
usaco 3.1 Humble Numbers
For a given set of K prime numbers S = {p1, p2, ..., pK}, considerthe set of all numbers whose prime factors are a subset of S. This setcontains, for example, p1, p1p2, p1p1, and p1p2p3 (amongothers). This is the set of `humble numbers' for the input set S. Note: Thenumber 1 is explicitly declared not to be a humble number.
Your job is to find the Nth humble number for a given set S. Longintegers (signed 32-bit) will be adequate for all solutions.
INPUT FORMAT
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.
SAMPLE INPUT
4 19
2 3 5 7
SAMPLE OUTPUT
27
为了提高我的题解逼格,所以usaco的就用英文好了,大家Google翻译一下就好了。
本题大意就是求第n个满足条件的数是多少,条件就是他是必须是p1,p2....pk的集合,范围不是很大,暴力枚举就好了。
程序有时间放上来,现在手上没有程序,在学校题库上
- USACO 3.1 Humble Numbers (humble)
- USACO 3.1 Humble Numbers
- USACO 3.1 humble numbers
- USACO 3.1 Humble Numbers
- USACO--3.1Humble Numbers
- USACO 3.1 Humble Numbers
- usaco 3.1 Humble Numbers
- USACO 3.1.3 Humble Numbers
- USACO Section 3.1 Humble Numbers
- USACO Section 3.1 Humble Numbers
- usaco Chapter 3 section 3.1 Humble Numbers
- USACO section 3.1 Humble Numbers(DP)
- USACO 3.1.3 Humble Numbers 丑数
- usaco-3.1-Humble Numbers-<set的使用>
- USACO-Section 3.1-PROB Humble Numbers
- USACO-Section 3.1 Humble Numbers(DP)
- USACO 3.1 Humble Numbers丑数
- USACO 3.1 Humble Numbers丑数
- Flume官方文档翻译之(九)
- 贝叶斯分类算法
- Python爬虫——糗百
- 12. Integer to Roman
- 解决windows server 2008 R2安装到D盘的问题
- usaco 3.1 Humble Numbers
- html 页面超出范围没有自动出现滚动条
- 读入一系列整数,统计出正整数个数i和负整数个数j,读入0则结束
- ++和--前后位置不同的区别
- CF#712 C. Memory and De-Evolution (数学)
- wine----Ubuntu下打开exe等windows下的应用程序
- wire与reg的区别?什么时候用wire?什么时候用reg?
- 如何用bat脚本自动注册bat目录下的文件
- HTML/CSS:编写合法HTML页面简明指南