hdu 1558 Segment set
2016-05-14 11:30
232 查看
Segment set
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4484 Accepted Submission(s): 1677[align=left]Problem Description[/align]
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.
[align=left]Input[/align]
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.
[align=left]Output[/align]
For each Q-command, output the answer. There is a blank line between test cases.
[align=left]Sample Input[/align]
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
[align=left]Sample Output[/align]
1
2
2
2
5
相关文章推荐
- QEMU-KVM中的多线程压缩迁移技术
- Servlet学习(一)Servlet简介以及实现Hello World
- 今年暑假不ac
- 总结thinkphp快捷查询getBy、getField、getFieldBy用法及场景
- XML语言
- 【转】keypress keydown keyup 区别
- 我自己总结的C#开发命名规范整理了一份
- JavaWeb学习笔记——Tomcat数据源
- c#串口温度数据的波形采集
- 拉低程序员社会地位的十大因素
- 20款Notepad++插件
- 图的存储结构
- 【转载】GitHub Top 100 简介(IOS框架)
- oracle数据库查询语句
- 使用Easp实现多维的k => v
- H264相关知识
- C#: 获取执行程序所在路径和启动资源管理器
- U-Boot源码——lowlevel_init.S
- Adam学习21之在Ubuntu下编译安装记录
- 线段树 例三