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:自己写的第K的居然TLE。。。

Posted by SEI069049 at 2010-06-08 20:54:15 on Problem 2623
In Reply To:自己写的第K的居然TLE。。。 Posted by:lcjh at 2010-03-22 21:06:42
同感,我用C++和Java两种语言分别写找出第K小元素的方法,结果无情的TLE,但是直接用自己写的MergeSort方法(归并排序),排序后再计算,却能AC。根据算法时间复杂度分析,后者是O(n * log(n)),而前者是O(n),结果确实令人疑惑,但是从我的实现来看,找出第K小元素的方法采用递归,也许是时间耗费在递归上,其它的原因就不得而知。

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