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:为什么总是WA,哪位帮忙看看啊

Posted by lsz at 2007-09-28 03:23:56 on Problem 1068
In Reply To:为什么总是WA,哪位帮忙看看啊 Posted by:lsz at 2007-09-28 03:10:51
我的思路是先得出原来的括号串,然后计算括号的层数。从右括号向左搜索,如果遇到第一个层数比当然括号内的层数要少的地方,这就是对应的左括号的位置。例如:
6
4 5 6 6 6 6
 ( ( ( ( ) ( ) ( ) ) ) )
0 1 2 3 4 3 4 3 4 3 2 1 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