22695_Max'spoin

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

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

Pro.ID

22695

Title

Max's point

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 6/65536 K (Java/Others)
  • 描述

    Given a set of points, say P, in two dimension. Define the subset of P, say S, as follows:

    For any three points, say i, j, k, of S, it holds that:

    dis(i, j) = dis(j, k) = dis(i, k)   ( here dis(i, j) means the distance between point i and j )

    It is your task to find the number of S which just contains 3 points in it.

    输入

    Input contains multiple test data sets.

    For each data set, first comes one integer n ( 1 ≤ n ≤ 1000000 ), the number of the points. Then n lines follow, each has two integer numbers x, y ( |x| < 1.5*109, |y| < 1.5*109 ), the coordinates of that point. The points may be overlaped, but they are regarded as different points. Refer to Sample Input for details.

    Input is terminated by EOF.

    输出

    Description

    Given a set of points, say P, in two dimension. Define the subset of P, say S, as follows:

    For any three points, say i, j, k, of S, it holds that:

    dis(i, j) = dis(j, k) = dis(i, k)   ( here dis(i, j) means the distance between point i and j )

    It is your task to find the number of S which just contains 3 points in it.

    Input

    Input contains multiple test data sets.

    For each data set, first comes one integer n ( 1 ≤ n ≤ 1000000 ), the number of the points. Then n lines follow, each has two integer numbers x, y ( |x| < 1.5*109, |y| < 1.5*109 ), the coordinates of that point. The points may be overlaped, but they are regarded as different points. Refer to Sample Input for details.

    Input is terminated by EOF.

    Output

    For each test data set, one output data set should be generated as follow:

    Output one integer per line presenting the number of subsets S satisfying the conditions described above.

    Sample Input

    3
    0 0
    0 0
    0 0
    2
    1 1
    1 1
    3
    0 0
    1 0
    0 0

    Sample Output

    1
    0
    0

    Source

    样例输入

    3
    0 0
    0 0
    0 0
    2
    1 1
    1 1
    3
    0 0
    1 0
    0 0

    样例输出

    1
    0
    0

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部