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

这题是这么回事

Posted by FuckYouFuckingMe at 2012-02-28 16:21:25 on Problem 2205 and last updated at 2012-02-28 16:22:28
1、0是1位数。
2、平方的末n位只由原数的末n位决定。(所以假如WXYZ合法,则XYZ一定合法)
3、发现一个n位数平方的倒数第n位是 (sum{a[i]*a[n-i+1]}+上一位进位) mod base (1<=i<=n),进位是 (sum{a[i]*a[n-i+1]}+上一位进位) div base (1<=i<=n).
4、从个位开始往前搜索。(2000层的递归搜索无压力)
5、发现第三条中的公式是对称的,所以只需暴力枚举 1<=i<=n/2 ,注意奇偶。

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