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

建议使用的浏览器:

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

2441:ACM(Array Complicated Manipulation)

题目描述
Given an infinite array of integers 2,3,.... Now do some operations on it.

The operation is to choose a minimum number from the array which is never been chosen, then change the status of its multiples excluding itself, i.e remove the multiples of the chosen number if they are in the array , otherwise add it to the array.keep the order after change.

For instance, the first step, choose number 2, change the status of 4, 6, 8, 10... They are all removed from the array. The second step, choose 3, change the status of 6, 9, 12, 15...

Pay attention: 9 and 15 are removed from the array while 6 and 12 are added to the array.
输入解释
Every line contains an integer n. The zero value for n indicates the end of input.
输出解释
Print "yes" or "no" according whether n is in the array.

输入样例
2
30
90
0
输出样例
yes
yes
no

提示
The number n never has a prime factor greater than 13000000, but n may be extremely large.
来自杭电HDUOJ的附加信息
Recommend gaojie

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

源链接: HDU-2441

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

共提交 0

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