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

建议使用的浏览器:

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

3803:gxx's Problem

题目描述
  In ACM_DIY, there is a master called “gxx”. Whenever someone asks a problem, he will come out with the Source (such as “in ** OJ, the ID to this problem is **”), then say “The Problem is ShaX……Isn’t it a problem that you should kill in a second? ……” or something like that. One day, one giantarum called ac wants to ask something about the common point(s) of two given “Segments”. Each segment is described as two points in 2D.
  Of course, gxx says: “It’s a problem that could be killed in one second!” However, the giantarum ac does not know how to solve this problem, could you help him?
输入解释
  The first line contains one integer T, indicates the number of the test cases. (T <= 100)
  Then every case has two lines. Each line has four integer numbers x0 y0 x1 y1, indicates the two end-points of the segment. (0<=|x0|, |y0|, |x1|, |y1| <= 10^6)
  All the test cases are seperated by a single blank line.
输出解释
Output one integer M in a single line, indicates the number of common point(s) of the two given segment.
Then M lines, each line has two fractions in lowest term indicate the common point.
(Of course, if the denominator is one, then you should ignore it!)
Obviously, if lots of points could be found, just output one line “INF”.
输入样例
5
0 0 1 1
1 0 0 1

0 0 1 0
1 1 2 2

0 0 -1 -1
-1 0 0 -1

0 0 2 2
2 2 4 0

0 0 1 1
0 0 1 1
输出样例
1
1/2 1/2
0
1
-1/2 -1/2
1
2 2
INF
来自杭电HDUOJ的附加信息
Author AekdyCoin
Recommend lcy

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

源链接: HDU-3803

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

共提交 0

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