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 sunmoonstar at 2006-07-14 20:58:45
In Reply To:请教zoj 2614,Bridge.30th ICPC杭州.做过的请问有什么陷阱啊,是不是直接解方程? Posted by:majia001 at 2006-07-14 20:53:34
> THE 30th ACM/ICPC ASIA REGIONAL 2005 HANGZHOU SITE
> Onsite Contest Session
> 
> Problem B: Bridge
> A suspension bridge suspends the roadway from huge main cables, which extend from one end of the bridge to the other. These cables rest on top of high towers and are secured at each end by anchorages. The towers enable the main cables to be draped over long distances. 
> 
> Suppose that the maximum distance between two neighboring towers is D, and that the distance from the top of a tower to the roadway is H. Also suppose that the shape of a cable between any two neighboring towers is the same symmetric parabola (as shown in the figure). Now given B, the length of the bridge and L, the total length of the cables, you are asked to calculate the distance between the roadway and the lowest point of the cable, with minimum number of towers built (Assume that there are always two towers built at the two ends of a bridge). 
> 
> Input Description
> 
> Standard input will contain multiple test cases. The first line of the input is a single integer T (1 <= T <= 10) which is the number of test cases. T test cases follow, each preceded by a single blank line. 
> 
> For each test case, 4 positive integers are given on a single line.
> D - the maximum distance between two neighboring towers;
> H - the distance from the top of a tower to the roadway;
> B - the length of the bridge; and
> L - the total length of the cables.
> 
> 
> It is guaranteed that B <= L. The cable will always be above the roadway. 
> 
> Output Description
> 
> Results should be directed to standard output. Start each case with "Case #:" on a single line, where # is the case number starting from 1. Two consecutive cases should be separated by a single blank line. No blank line should be produced after the last test case. 
> 
> For each test case, print the distance between the roadway and the lowest point of the cable, as is described in the problem. The value must be accurate up to two decimal places. 
> 
> Sample Input
> 
> 2
> 
> 20 101 400 4042
> 
> 1 2 3 4
> 
> Sample Output
> 
> Case 1:
> 1.00
> 
> Case 2:
> 1.60

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