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 |
我的一点小见解这道题其实可以转化成裴蜀定理: ax+by = 1; 题意转化成数学知识就是:ax%y=m,m要取到0-(y-1)的所有值,其中x是step,y是mod,ax表示x的整数倍,因为seed(0)=0 该式就等价于ax+by=m,很明显,m可以取到0,就是初值, 然后如果m要取到0-(y-1)的所有值,那么ax+by=1就一定要成立,因为如果ax+by=1,那么只要在两边同时乘(1-m-1中任何一个数)就好了, Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator