22296_Polylops

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

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

Pro.ID

22296

Title

Polylops

Title链接

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

AC

1

Submit

1

Ratio

100.00%

时间&空间限制

  • Time Limit: 900/300 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    Given the vertices of a non-degenerate polygon (no 180-degree angles, zero-length sides, or self-intersection - but not necessarily convex), you must determine how many distinct lines of symmetry exist for that polygon. A line of symmetry is one on which the polygon, when reflected on that line, maps to itself.

    输入

    Input consists of a description of several polygons.

    Each polygon description consists of two lines. The first contains the integer "n" ( 3 <= n <= 1000 ), which gives the number of vertices on the polygon. The second contains "n" pairs of numbers (an x- and a y-value), describing the vertices of the polygon in order. All coordinates are integers from -1000 to 1000.

    Input terminates on a polygon with 0 vertices.

    输出

    Description
    Given the vertices of a non-degenerate polygon (no 180-degree angles, zero-length sides, or self-intersection - but not necessarily convex), you must determine how many distinct lines of symmetry exist for that polygon. A line of symmetry is one on which the polygon, when reflected on that line, maps to itself.
    Input
    Input consists of a description of several polygons.

    Each polygon description consists of two lines. The first contains the integer "n" ( 3 <= n <= 1000 ), which gives the number of vertices on the polygon. The second contains "n" pairs of numbers (an x- and a y-value), describing the vertices of the polygon in order. All coordinates are integers from -1000 to 1000.

    Input terminates on a polygon with 0 vertices.

    Output
    For every polygon described, print out a line saying "Polygon #x has y symmetry line(s).", where x is the number of the polygon (starting from 1), and y is the number of distinct symmetry lines on that polygon.
    Sample Input
    4
    -1 0 0 2 1 0 0 -1
    3
    -666 -42 57 -84 19 282
    3
    -241 -50 307 43 -334 498
    0
    Sample Output
    Polygon #1 has 1 symmetry line(s).
    Polygon #2 has 0 symmetry line(s).
    Polygon #3 has 1 symmetry line(s).
    Source

    样例输入

    4
    -1 0 0 2 1 0 0 -1
    3
    -666 -42 57 -84 19 282
    3
    -241 -50 307 43 -334 498
    0

    样例输出

    Polygon #1 has 1 symmetry line(s).
    Polygon #2 has 0 symmetry line(s).
    Polygon #3 has 1 symmetry line(s).

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部