找回密码
 欢迎注册
查看: 8415|回复: 2

[原创] A new problem

[复制链接]
发表于 2011-10-11 15:07:58 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?欢迎注册

×
Given an big integer N, how to judge that whether there exists an integer m where N=m*m with O(1) time complexity.
For example, for the number 9, there exists an integer 3 that 3*3=9.
For the number 18, we cannot find the proper number.

PS: MUST BE O(1) time complexity , which means your method can be done in constant step no matter how big the number N  is.
MUST TAKE IT INTO CONSIDERATION that N is a very very large integer.
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-10-11 16:22:08 | 显示全部楼层
O(1)不太可能吧,依据完全平方数的性质可以判断一些数,但是不能判断所有数
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2011-10-11 16:25:15 | 显示全部楼层
不知道这样算不算:
先算$m=\sqrt{N}$
然后判断$m*m$是否等于$N$,但是对于大数就不行了
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-5-8 07:55 , Processed in 0.055211 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表