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 |
过的了1811 为何就过不了这个题目,大牛看一下我的扩展欧几里德没错吧,换了好几个版本了,谢过typedef __int64 LLD; LLD Ext_Eculid(LLD E, LLD T) { if (E == 0 || T == 0) return 0; LLD x1=1,x2=0,x3=E,y1=0,y2=1,y3=T,t1,t2,t3; for (t3 = x3 % y3; t3!=0; t3 = x3 % y3) { LLD k = x3 / y3; t1 = x1 - k * y1; t2 = x2 - k * y2; x1 = y1; x2 = y2; x3 = y3; y1 = t1; y2 = t2; y3 = t3; } return t1; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator