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 |
稍微剪枝就很快了DUP是增加1个数,其余都是减少一个数。 要保证结束时栈只有一个数且中间计算都不会少于2个数,加上下面剪枝: 1. 操作个数必须是偶数(增加一个数就必须减少一个) 2. DUP个数为L/2 3. 到第i个操作为止,DUP个数必须保证>=i/2+1 (i从0开始) Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator