当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1796:How many integers can you find

题目描述
  Now you get a number N, and a M-integers set, you should find out how many integers which are small than N, that they can divided exactly by any integers in the set. For example, N=12, and M-integer set is {2,3}, so there is another set {2,3,4,6,8,9,10}, all the integers of the set can be divided exactly by 2 or 3. As a result, you just output the number 7.
输入解释
  There are a lot of cases. For each case, the first line contains two integers N and M. The follow line contains the M integers, and all of them are different from each other. 0<N<2^31,0<M<=10, and the M integer are non-negative and won’t exceed 20.
输出解释
  For each case, output the number.
输入样例
12 2
2 3
输出样例
7
来自杭电HDUOJ的附加信息
Author wangye
Recommend wangye

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-1796

最后修改于 2020-10-25T22:47:50+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
12000/5000MS(Java/Others) 65536/32768K(Java/Others)