• hdu 1558 Segment set


    Segment set

    Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4484    Accepted Submission(s): 1677

    Problem Description
    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.
     
    Input
    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.
     
    Output
    For each Q-command, output the answer. There is a blank line between test cases.
     
    Sample Input
    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
     
    Sample Output
    1
    2
    2
    2
    5
    越努力,越幸运
  • 相关阅读:
    vue与laravel
    php artisan 命令
    HTTP 状态码
    PhpStorm提高效率的使用方法及设置
    好RESTful API的设计原则
    laravel 入门基础之安装
    c++ sizeof(字符数组)
    new delete/delete[] 测试
    linux g++ 查找动态链接库
    linux下定时器耗时研究
  • 原文地址:https://www.cnblogs.com/qinduanyinghua/p/5492206.html
Copyright © 2020-2023  润新知