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:太出乎意料了。。。一次就AC了。。。In Reply To:太出乎意料了。。。一次就AC了。。。 Posted by:cssdnx at 2011-05-07 09:27:36 > 抽屉原理~ 每次求前N项和,每个和对N取余,如果能出现0,那么就是答案,如果取了N次没有0,那么就有N个余数,余数的范围为1~n-1,所以必有两个相同的余数,那么取得这两个相同余数的前N项和的差就是答案~ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator