Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
欢迎参加IJCAI 2020麻将智能体竞赛,大奖等你拿!Welcome to IJCAI 2020 Mahjong AI competition with amazing prizes!

Re:请教一下为什么是求n以内完全平方数个数?谢谢

Posted by hldyxh at 2008-08-01 16:37:21 on Problem 1218
In Reply To:请教一下为什么是求n以内完全平方数个数?谢谢 Posted by:zmcz at 2006-10-02 10:03:41
点灯那个题目总听说过吧,和这个一模一样。
凡是1的倍数的都要切换一次
凡是2的倍数的都要切换一次
。。。
。。。
。。。
凡是n-1的倍数都要切换一次
凡是n的倍数都要切换一次

最后,凡是被切换奇数次的都跑了,1(1),4(1,2,4),9(1,3,9),16(1,2,4,8,16)
25(1,5,25),36(1,2,3,6,12,18,36)...依此类推。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator