Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
一次AC,我的算法,大家参考参考将P转换为01序列,0代表“(”,1代表“)” 遍历序列,查到1后回溯,遇到0,则将0变为2,并停止回溯; 遇到2,则sum++. 最后把sum存放到另外一个数组即可。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator