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

一次AC,我的算法,大家参考参考

Posted by erikajason at 2009-08-10 16:06:33 on Problem 1068
将P转换为01序列,0代表“(”,1代表“)”
遍历序列,查到1后回溯,遇到0,则将0变为2,并停止回溯;
遇到2,则sum++.
最后把sum存放到另外一个数组即可。

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