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

大家是怎么做到这么快的= =

Posted by mingrimingyue at 2011-04-30 09:48:17 on Problem 3693
我的做法:
开始和spoj的那题一样,枚举长度i,然后算到了(j,j+i)的lcp,然后看是不是能往前挪。这里不能像spoj那样挪,因为字典序最小可能还在前面,所以我把串倒过来,在(n-i-j,n-j)再求了一次lcp,假如说是L(假如可以使重复长度加1),那么就在原串中读取(j-L,重复长度能+1的最靠后的位置)中rank最小的值,这样一定能保证是字典序最小。
网上很多方法都是o(n^2)的……我o(nlogn)的实现好慢啊……T T

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