21429_Saskatchewan

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

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

Pro.ID

21429

Title

Saskatchewan

Title链接

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

AC

7

Submit

27

Ratio

25.93%

时间&空间限制

  • Time Limit: 8000/4000 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    The province of Saskatchewan is surveyed in sections. A section is a square mile of land. Grid roads delimit sections; there is one north-south and one east-west road exactly every mile. (Complications arise because of the curvature of the earth but you can disregard these and assume that the province is a plane.) The provincial border is a polygon whose vertices correspond to the intersections of grid roads. However, the edges do not necessarily follow grid roads; some sections are cut by the border. Your job is to compute how many sections are completely within a province like Saskatchewan.

    输入

    Standard input contains a series of no more than 100 coordinate pairs, one pair per line. These coordinates give the vertices of the perimeter of the province; the border is formed by connecting them in order. All coordinates are in the first quadrant; they range from 0 to 100,000.

    输出

    Description

    The province of Saskatchewan is surveyed in sections. A section is a square mile of land. Grid roads delimit sections; there is one north-south and one east-west road exactly every mile. (Complications arise because of the curvature of the earth but you can disregard these and assume that the province is a plane.) The provincial border is a polygon whose vertices correspond to the intersections of grid roads. However, the edges do not necessarily follow grid roads; some sections are cut by the border. Your job is to compute how many sections are completely within a province like Saskatchewan.

    Input

    Standard input contains a series of no more than 100 coordinate pairs, one pair per line. These coordinates give the vertices of the perimeter of the province; the border is formed by connecting them in order. All coordinates are in the first quadrant; they range from 0 to 100,000.

    Output

    Your output should be a single integer: the number of sections (i.e. unit squares with corners at integer coordinates) fully contained within the province.

    Sample Input
    0 0
    0 100000
    99999 100000
    100000 0
    Sample Output

    9999900000

    Source

    样例输入

    0 0
    0 100000
    99999 100000
    100000 0

    样例输出

    9999900000

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部