当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2812:Extrusion

题目描述
The Acme Extrusion Company specializes in the production of steel bars with custom-designed cross-sections. The manufacturing process involves cutting a hole in a thick metal plate, the shape of the hole being determined by the customer's specifications.

Molten metal is then forced through the hole to form a long bar. The shape of the hole determines the shape of the cross-section of the resulting bar.

Given a description of a polygonal hole and the volume of molten metal available, determine how long a bar can be formed by this process.
输入解释
Input consists of one or more data sets consisting of the following information:

  • An integer, N , indicating the number of vertices making up the polygon. End of input is signaled by any N less than 3.
  • Next are N lines, each containing a pair of floating-point numbers, (xi, yi) , each denoting one vertex of the polygon. Vertices will be presented in clockwise order (relative to the closest interior point) proceeding around the perimeter of the polygon. The xi and yi values are in units of meters.
  • The data set is terminated by a floating point value indicating the amount of molten metal available (in cubic meters).

输出解释
For each data set, the program should produce a single line of output of the form:

BAR LENGTH: x

where ``x " is the maximum bar length, a floating point number expressed with two digits precision.
输入样例
4
0.0 0.0
0.0 0.1
0.1 0.1
0.1 0.0  
1.0
7
0.5 1.25
0.9 1.6
0.9  1.1
0.85 1.0
0.9 0.85
0.9 0.5
0.5 0.75
100.0
0
输出样例
BAR LENGTH: 100.00 
BAR LENGTH: 318.73

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 Mid-Atlantic 2005

源链接: POJ-2812

最后修改于 2020-10-29T06:44:56+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536