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

Re:Time Limit Exceeded 怎么该啊!算法不会,大侠指点啊!

Posted by Kuroro at 2012-11-30 11:12:58 on Problem 1061
In Reply To:Time Limit Exceeded 怎么该啊!算法不会,大侠指点啊! Posted by:wzdhlj2 at 2011-12-06 23:20:10
ax = b%n
我刚尝试了下,如果不没有这段代码,1000组数据耗时3951,用了耗时134
	long tmp = extgcd(a, b);
		if(tmp >1)
		{
			a= a/tmp;
			b= b/tmp;
		}

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