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

请问这道题怎么剪枝?

Posted by gniuxiao at 2007-01-08 18:17:39 on Problem 1100
我能想到的只有奇偶性判断(如果等式左边是奇数,右边全是偶数则直接fail)和最大值判断(如果右边用+和*能够得到的最大值小于左边,直接fail),如果这两个判断都过了,就只能穷举运算符的所有排列了,从小到大穷举(+<-<*),如果等式成立了就succeed,这样time complexity是O(2^N),其中N是运算符个数。。。。

过了的说说怎么剪枝的吧,谢谢,我一直TLE~ :-)

PS:这道题用java做的,不知道会不会和这个有关,应该是没有关系的。。

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