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 |
wa了数十次终于用逆元过了In Reply To:Re:用逆元wa到不行 很想知道这道题有没有人用逆元过的啊~ Posted by:305636397 at 2011-07-05 10:03:31 要注意两种特殊情况: x%9901==1的情况比较容易引起警觉,这种情况下不能用逆元,直接输出n+1就好了; x%9901==0则比较隐蔽,因为通常都是求x^(n+1)%9901,然后再减一,一不注意就输出-1了 我一开始就注意到第一种了,结果在第二个错误上wa到吐血 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator