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:怎么用栈?

Posted by frkstyc at 2007-10-23 18:38:03 on Problem 3415
In Reply To:怎么用栈? Posted by:044100324 at 2007-10-23 17:37:18
aaaaaaaaaaaaaaaaaa#aaaaaaaaaaaaaaaaaa
后缀数组肯定是
#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
然后栈里面的情况肯定是
1 2 3 4 5...
统计的时候每次只需要加上栈顶元素相关的数量,于是O(n)...

> 如果输入是
> 1
> aaaaaaaaaaaaaaaaaa
> aaaaaaaaaaaaaaaaaa
> 这种感觉就是要O(n*n)!
> 
> 请教一下AC的方法!

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