编程介的小学生 2017-01-02 13:16 采纳率: 20.5%
浏览 811
已采纳

Beach cut

Description

The seashore is represented by a polyline without self-intersections, described by a sequence of vertices (x1, y1), ... (xN, yN). It also has a property that xi < xi + 1. The sea is above the line, and the beach -- below.

Your program must connect two vertices with a straight line not longer than L chosen so as to maximize the beach area enclosed between that line and the shore. The line must not intersect with the sea and may only touch, not intersect, the shore polyline.
Constraints
3 ≤ N ≤ 5000, 0 ≤ xi, yi, L ≤ 1000000
Input

Input contains integer numbers N L, followed by N pairs of integers x1 y1 … xN yN.
Output

Output must contain a single floating point value -- the maximum area that can be cut (it may be zero). The area must be output exactly, i.e. without any rounding at all.
Sample Input

5 4
0 0 1 3 2 0 3 3 4 0
Sample Output

6

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-01-07 15:48
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制