当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3256:Grid Point Counting

题目描述
You have a number of sticks, which are thin enough to be considered as segments on the XY plane.

Your task is simple: count the number of grid points that are covered by at least one segment.
输入解释
The first line contains a single integer T (T <= 10), the number of test cases.
Each case begins with an integer n (1 <= n <= 500), the number of segments.
Each of the following n lines contains four real numbers x1, y1, x2, y2, denoting a segment (x1,y1)-(x2,y2).
All of x1, y1, x2, y2 will be no larger than 10000 in their absolute values, and will contain at most 4 digits after decimal point.
输出解释
For each test case, print the case number and the number of grid points.
输入样例
2
2
-1 0 1 0
0 1 0 -1
1
1 2 3 4.0001
输出样例
Case 1: 5
Case 2: 1
来自杭电HDUOJ的附加信息
Recommend wujianhua

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3256

最后修改于 2020-10-25T23:01:42+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
14000/7000MS(Java/Others) 32768/32768K(Java/Others)