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:TLE help;

Posted by beiyouyu at 2007-07-09 13:16:58 on Problem 3244
In Reply To:TLE help; Posted by:hduOZ at 2007-07-09 12:55:33
for(i=0;i<n;i++)
		{
			for(j=i+1;j<n;j++)
			{
				sum=sum+((x[i]-x[j])+(y[i]-y[j])+(z[i]-z[j]))/2;
			}
		}


那这个降为O(n)

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