Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

过的了1811 为何就过不了这个题目,大牛看一下我的扩展欧几里德没错吧,换了好几个版本了,谢过

Posted by xiaox at 2007-05-20 17:19:05 on Problem 2447
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator