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

建议使用的浏览器:

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

1558:Segment set

题目描述
A segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in it. The problem is to find the size of some segment set.

输入解释
In the first line there is an integer t - the number of test case. For each test case in first line there is an integer n (n<=1000) - the number of commands.

There are two different commands described in different format shown below:

P x1 y1 x2 y2 - paint a segment whose coordinates of the two endpoints are (x1,y1),(x2,y2).
Q k - query the size of the segment set which contains the k-th segment.

k is between 1 and the number of segments in the moment. There is no segment in the plane at first, so the first command is always a P-command.
输出解释
For each Q-command, output the answer. There is a blank line between test cases.
输入样例
1
10
P 1.00 1.00 4.00 2.00
P 1.00 -2.00 8.00 4.00
Q 1
P 2.00 3.00 3.00 1.00
Q 1
Q 3
P 1.00 4.00 8.00 2.00
Q 2
P 3.00 3.00 6.00 -2.00
Q 5
输出样例
1
2
2
2
5
来自杭电HDUOJ的附加信息
Author LL
Recommend LL

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

源链接: HDU-1558

最后修改于 2020-10-25T22:46:00+00:00 由爬虫自动更新

共提交 431

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