2438.Conway's Conjecture

通过数:9提交数:12学校:浙江大学保研机试真题 题目列表 标签
题目描述 John Horton Conway, a British mathematician active in recreational mathematics, proposed a conjecture in 2014: arrange the factors of any given number in ascending order, and pull the exponents down, we can get another number. Keep doing so we must end up at a prime number. For example: $ 18 = 2 \times 3^2 \rightarrow 232 = 2^3 \times 29 \rightarrow 2329 = 17 \times 137 \rightarrow 17137 $ (which is a prime). Now you are supposed to write a program to make one step verification of this conjecture. That is, for any given positive integer $ N $, you must factorize it, and then test if the number obtained from its factors is a prime. By the way, this conjecture has been proven false by James Davis, who has discovered a counterexample: $ 135323853961879 = 13 \times 53^2 \times 3853 \times 96179 $. Alas... 输入格式 Each input file contains one test case which gives a positive integer $ N $ ($ <10^5 $). 输出格式 For each case, first print in a line the number obtained from $ N $'s factors. Then in the next line, print Yes if the above number is a prime, or No if not. 输入样例 2329 输出样例 17137 Yes
C
补全
点击调试按钮即可调试代码。

点击提交按钮即可提交代码。