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:wa了数十次终于用逆元过了

Posted by zck921031 at 2013-10-04 20:51:06 on Problem 1845
In Reply To:wa了数十次终于用逆元过了 Posted by:Tornado at 2011-07-20 09:47:37
> 要注意两种特殊情况:
> x%9901==1的情况比较容易引起警觉,这种情况下不能用逆元,直接输出n+1就好了;
> x%9901==0则比较隐蔽,因为通常都是求x^(n+1)%9901,然后再减一,一不注意就输出-1了
> 我一开始就注意到第一种了,结果在第二个错误上wa到吐血
-------------------------------------
弱问,a/b=0/0 (mod p),出现除0怎么用逆元算?

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