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 |
Re:wa了数十次终于用逆元过了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator