22619_JungleOutpos

2022-5-16 18:22| 发布者: Hocassian| 查看: 17| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506791962900-Problem List-采集的数据-后羿采集器.html

Pro.ID

22619

Title

Jungle Outpost

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22619

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 20000/10000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    There is a military base lost deep in the jungle. It is surrounded by n watchtowers with ultrasonic generators. In this problem watchtowers are represented by points on a plane.

    Watchtowers generate ultrasonic field and protect all objects that are strictly inside the towers' convex hull. There is no tower strictly inside the convex hull and no three towers are on a straight line.

    The enemy can blow up some towers. If this happens, the protected area is reduced to a convex hull of the remaining towers.

    The base commander wants to build headquarters inside the protected area. In order to increase its security, he wants to maximize the number of towers that the enemy needs to blow up to make the headquarters unprotected.

    输入

    The first line of the input file contains a single integer n ( 3 ≤ n ≤ 50000 ) — the number of watchtowers. The next n lines of the input file contain the Cartesian coordinates of watchtowers, one pair of coordinates per line. Coordinates are integer and do not exceed 106 by absolute value. Towers are listed in the order of traversal of their convex hull in clockwise direction.

    输出

    Description

    There is a military base lost deep in the jungle. It is surrounded by n watchtowers with ultrasonic generators. In this problem watchtowers are represented by points on a plane.

    Watchtowers generate ultrasonic field and protect all objects that are strictly inside the towers' convex hull. There is no tower strictly inside the convex hull and no three towers are on a straight line.

    The enemy can blow up some towers. If this happens, the protected area is reduced to a convex hull of the remaining towers.

    The base commander wants to build headquarters inside the protected area. In order to increase its security, he wants to maximize the number of towers that the enemy needs to blow up to make the headquarters unprotected.

    Input

    The first line of the input file contains a single integer n ( 3 ≤ n ≤ 50000 ) — the number of watchtowers. The next n lines of the input file contain the Cartesian coordinates of watchtowers, one pair of coordinates per line. Coordinates are integer and do not exceed 106 by absolute value. Towers are listed in the order of traversal of their convex hull in clockwise direction.

    Output

    Write to the output file the number of watchtowers the enemy has to blow up to compromise headquarters protection if the headquarters are placed optimally.

    Sample Input

    Sample #1
    3
    0 0
    50 50
    60 10

    Sample #2
    5
    0 0
    0 10
    10 20
    20 10 25 0

    Sample Output

    Sample #1
    1

    Sample #2
    2

    Source

    样例输入

    Sample #1
    3
    0 0
    50 50
    60 10

    Sample #2
    5
    0 0
    0 10
    10 20
    20 10 25 0

    样例输出

    Sample #1
    1

    Sample #2
    2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部