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

勉强算dp吧 ...

Posted by The_Dawn at 2011-04-18 16:30:59 on Problem 2138
首先将所有单词按长度排序。
v[i]表示排序后的第i个单词能否取到。
预处理出一个long[i]数组,表示长度为i的第一个单词在全部单词中的位置。
然后v[i]=v[i] or v[j]  (j=long[length(s[i-1])] to long[length(s[i])-1])
最后取长度最大的可以取到的单词就可以了。
各种蛋疼数据的特判看discuss里其他帖子..
以上.

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