Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这题是这么回事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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator