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

为什么减枝仍旧TLE

Posted by leonardWang at 2009-08-16 12:22:43 on Problem 2192
后来不得不把每个算出来的值记在2维数组里 才过了

bool solve(int p1,int p2,int p3)  //表示判断s1,s2,s3的位置
{}
当s1[p1]!=s3[p3]&&s2[p2]!=s3[p3]时直接返回false;
但如果
s1[p1]==s3[p3]&&s2[p2]==s3[p3]的时候(第二个实例里t的时候)应该仍旧要算solve(p1+1,p2,p3+1)和solve(p1,p2+1,p3),然后2个结果或一下,这里面的重复计算怎么减掉?
就是说比如ttttttt tttttt tttttttttttt这种类型时,重算计算了很多怎么处理?

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