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 humanjustic at 2006-12-24 10:02:35 on Problem 1980
每一步分母的范围:
最小值 = Max(上一步的分母,剩余分数的倒数的整数部分)
最大值 = Min(剩余分数除以剩余的未确定的分式个数的倒数的整数部分,a/这一步累乘的值+1)

说明一下:
这一步累乘的值 
比如2/3扩展到第三步,前两步如下:2/3 = 1/4+1/4+? . 那么这一步累乘的值 = 4*4 = 16;

剩余分数除以剩余的未确定的分式个数的倒数的整数部分
比如2/3扩展到第二步(假设这一次规定扩展三步),前一步如下:2/3 = 1/4+?+? . 
那么剩余分数除以剩余的未确定的分式个数的倒数的整数部分 = 1 /( (2/3-1/4)/(3-1) )
其中(2/3-1/4) 是剩余分数  (3-1)是剩余的未确定的分式个数.

显然每一次搜索都要规定最大深度..

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