21306_BeautyContes

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

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

Pro.ID

21306

Title

Beauty Contest

Title链接

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

AC

4

Submit

10

Ratio

40.00%

时间&空间限制

  • Time Limit: 0/0 MS (Java/Others)     Memory Limit: 0/0 K (Java/Others)
  • 描述

    Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N ( 2 ≤ N ≤ 50,000 ) farms around the world in order to spread goodwill between farmers and their cows. For simplicity, the world will be represented as a two-dimensional plane, where each farm is located at a pair of integer coordinates ( x, y ), each having a value in the range -10,000 ... 10,000. No two farms share the same pair of coordinates.

    Even though Bessie travels directly in a straight line between pairs of farms, the distance between some farms can be quite large, so she wants to bring a suitcase full of hay with her so she has enough food to eat on each leg of her journey. Since Bessie refills her suitcase at every farm she visits, she wants to determine the maximum possible distance she might need to travel so she knows the size of suitcase she must bring.

    Help Bessie by computing the maximum distance among all pairs of farms.

    输入

    * Line 1: A single integer, N

    * Lines 2..N+1: Two space-separated integers x and y specifying coordinate of each farm

    输出

    Description

    Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N ( 2 ≤ N ≤ 50,000 ) farms around the world in order to spread goodwill between farmers and their cows. For simplicity, the world will be represented as a two-dimensional plane, where each farm is located at a pair of integer coordinates ( x, y ), each having a value in the range -10,000 ... 10,000. No two farms share the same pair of coordinates.

    Even though Bessie travels directly in a straight line between pairs of farms, the distance between some farms can be quite large, so she wants to bring a suitcase full of hay with her so she has enough food to eat on each leg of her journey. Since Bessie refills her suitcase at every farm she visits, she wants to determine the maximum possible distance she might need to travel so she knows the size of suitcase she must bring.

    Help Bessie by computing the maximum distance among all pairs of farms.

    Input

    * Line 1: A single integer, N

    * Lines 2..N+1: Two space-separated integers x and y specifying coordinate of each farm

    Output

    * Line 1: A single integer that is the squared distance between the pair of farms that are farthest apart from each other.

    Sample Input

    4
    0 0
    0 1
    1 1
    1 0

    Sample Output

    2

    Hint

    Farm 1 (0, 0) and farm 3 (1, 1) have the longest distance (square root of 2)

    本题重复,请提交到22834

    Source

    样例输入

    4
    0 0
    0 1
    1 1
    1 0

    样例输出

    2

    提示

    Farm 1 (0, 0) and farm 3 (1, 1) have the longest distance (square root of 2)

    本题重复,请提交到22834


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部