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 userfriendly at 2009-05-26 17:10:07 on Problem 1141
In Reply To:奇怪这道题???不服这样的AC Posted by:1272406003 at 2009-04-29 17:11:11
1.当S=(S') 或 S=[S']时, r(S)=r(S')  r(S)表示串S在这个问题的解

2.否则把S从第k个处剪成两部分 叫串 S(1,k) 和 S(k+1,n)
那么r(S)=r(S(1,k))+r(S(k+1, n))
只需要枚举k,DP就行~~

不是这样讨论就可以了么? 那两段讨论完全多余了~~

例如
([(]  属于情况2, 枚举发现分割成 "(" 和 "[(]" 时得到最优(k=0) ~ 这样.

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