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:超过1000000000时就很溢出unsigned long long了,怎么办?In Reply To:超过1000000000时就很溢出unsigned long long了,怎么办? Posted by:4h at 2008-10-07 21:11:12 这题溢出不是很严重~~猥琐的一招~~ a*b%m=Mod(a,b,m); long long Mod(long long a,long long b,long long m) { long long ans1,ans2; ans1=a*(b%100000)%m; ans2=a*(b/100000)%m*100000%m; return (ans1+ans2)%m; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator