洞察探讨小游戏SDK接入的最佳实践以及对企业跨平台开发的优势
647
2022-10-20
HDU 1395 2^x mod n = 1(暴力枚举)
2^x mod n = 1
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15721 Accepted Submission(s): 4870
Problem Description
Give a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.
Input
One positive integer on each line, the value of n.
Output
If the minimum x exists, print a line with 2^x mod n = 1. Print 2^? mod n = 1 otherwise. You should replace x and n with specific numbers.
Sample Input
25
Sample Output
2^? mod 2 = 12^4 mod 5 = 1
Author
MA, Xiao
Source
ZOJ Monthly, February 2003
题解:暴力枚举....
TLE代码:
#include #include
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~