Problem 1889 --Problem B: Saskatchewan

1889: Problem B: Saskatchewan

"
Time Limit $10$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $1$ 正确数量 $1$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Problem B: Saskatchewan

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.

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.

0 0
0 100000
99999 100000
100000 0
9999900000

推荐代码 查看1889 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$908 $ms] AOJ大管家 84404 2017-04-27 15:28:24
内存最少[$952 $KB] AOJ大管家 84404 2017-04-27 15:28:24
第一AC AOJ大管家 84404 2017-04-27 15:28:24
第一挑战 AOJ大管家 84404 2017-04-27 15:28:24

赛题来源/所属竞赛 NA N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛