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

Re:什么叫乘法逆元?我表示我只会用二分法进行等比数列求和做此题……

Posted by lydliyudong at 2011-06-17 13:12:30 on Problem 1845 and last updated at 2011-06-17 13:33:05
In Reply To:倒,不会乘法逆元,用土鳖方法搞这题,写了高精才过的表示压力巨大…… Posted by:xuhaoran510 at 2011-04-10 10:55:54
RT
1+p+p^2+……+p^c=

1° odd(c)=true
 原式=cal(p,c)={p^[(c+1)>>1)] +1} *cal(p,(c-1)>>1);
2° odd(c)=false
 原式=cal(p,c)={p^[(c+1)>>1)] +1} *cal(p,(c-1)>>1) +p^c;

原理:例如c=3  分成(1+p)+(p^2+p^3)提出p^2,二分递归。
         c=4  分成(1+p)+(p^2+p^3)+(p^4),p^4单独计算。 

http://hi.baidu.com/lydrainbowcat/blog/item/7078dcfbdf43be0e6d22eb83.html

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