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: Your algorithm is OK.

Posted by antoniowyn at 2009-01-08 22:50:22 on Problem 2104
In Reply To:i can't reduce time longer! Posted by:azurespace at 2007-06-25 19:40:25
> 
> to solve this problem, I used Indexed tree recorded sorted sequences.
> 
> for example)
> 
> level 0) [1,  2,  3,  4,  5,  6,  7,  inf]
> level 1) [1,  2,  5,  6] [3,  4,  7,  inf]
> level 2) [1,  5] [2,  6] [3,  7] [4,  inf]
> level 3) [1] [5] [2] [6] [3] [7] [4] [inf]
> 
> [...] stand for a node of indexed tree.
> 
> it works, but not enough. therefore, i got TLE.
> 
> how can i reduce execution time?

Your algorithm is OK, use Merge Sort to to sort sequences between levels.

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