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

建议使用的浏览器:

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

2710:Max Factor

题目描述
To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is unaware that the cows interpret some serial numbers as better than others. In particular, a cow whose serial number has the highest prime factor enjoys the highest social standing among all the other cows.

(Recall that a prime number is just a number that has no divisors except for 1 and itself. The number 7 is prime while the number 6, being divisible by 2 and 3, is not).

Given a set of N (1 <= N <= 5,000) serial numbers in the range 1..20,000, determine the one that has the largest prime factor.
输入解释
* Line 1: A single integer, N

* Lines 2..N+1: The serial numbers to be tested, one per line
输出解释
* Line 1: The integer with the largest prime factor. If there are more than one, output the one that appears earliest in the input file.
输入样例
4
36
38
40
42
输出样例
38
来自杭电HDUOJ的附加信息
Recommend teddy

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

源链接: HDU-2710

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

共提交 0

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