22482_Clo

2022-5-16 18:22| 发布者: Hocassian| 查看: 29| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506480886700-Problem List-采集的数据-后羿采集器.html

Pro.ID

22482

Title

Cloth

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22482

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Recently Merlin is doing a big project --- The Cut Planning tool, which is used in cloth industry. The project is so simple, put one big cloth into many small pieces of cloth.

    Real cloth cutting is simple, but in the computer representation it becomes difficult. The computer couldn't judge the two small pieces of cloth intersect or not.

    Cloth is a simple polygon, not intersect by itself and haven't complex structure in center. And there aren't three adjoin points form one straight line.

    If there is at least one point is inside both of them (not include at the edge of the polygon), it considers the two of the polygons intersect.

    Each cloth is described in the following format:

    n
    x1  y1
    x2  y2
    ...
    xn  yn
    X  Y
    C
    A

    n is the number of vertices of the cloth. (quotes for clarity) is the coordinate of a vertex, which gives the original position of the cloth, in order. First we need to move, without any rotation, the cloth so that the most-left-down point of the cloth (with the minimum x coordinate and the minimum y coordinate in case of a tie) is at the position of the original point (0, 0). For the sake of convenience, we call this most-left-down point MLD point. "X Y" (quotes for clarity) is the final position of the MLD point, and will be explained later. C is a single character, which will only be 'T' or 'F'. If 'T' we need to turn the cloth 180 degrees about the y-axis, that is, make the x coordinate of each vertex -x. If 'F', nothing has to be done. A gives the angle by that we need to rotate counter-clockwise the cloth, based on the MLD point. Finally, we have to move, without any rotation, the cloth so that the MLD point is at the position of the point (X, Y). As you can see, we have to do some preprocesses as above about the cloth.

    You job is that, given the descriptions of two pieces of cloth, decide whether they intersect or not after all preprocesses.

    输入

    This problem has multiple test cases. In each test case, there are two pieces of descriptions in the given format, each for a piece of cloth. It is guaranteed that, there are at least 3 and at most 10 vertices of a cloth, and all coordinates in the input are integers not less than -10000 and not larger than 10000, the rotating angle is given in degree and will be between 0 and 360 degrees, inclusively.

    There is a blank line after each test case.

    The last test case is followed by a zero, which will not be processed.

    输出

    Description

    Recently Merlin is doing a big project --- The Cut Planning tool, which is used in cloth industry. The project is so simple, put one big cloth into many small pieces of cloth.

    Real cloth cutting is simple, but in the computer representation it becomes difficult. The computer couldn't judge the two small pieces of cloth intersect or not.

    Cloth is a simple polygon, not intersect by itself and haven't complex structure in center. And there aren't three adjoin points form one straight line.

    If there is at least one point is inside both of them (not include at the edge of the polygon), it considers the two of the polygons intersect.

    Each cloth is described in the following format:

    n
    x1  y1
    x2  y2
    ...
    xn  yn
    X  Y
    C
    A

    n is the number of vertices of the cloth. (quotes for clarity) is the coordinate of a vertex, which gives the original position of the cloth, in order. First we need to move, without any rotation, the cloth so that the most-left-down point of the cloth (with the minimum x coordinate and the minimum y coordinate in case of a tie) is at the position of the original point (0, 0). For the sake of convenience, we call this most-left-down point MLD point. "X Y" (quotes for clarity) is the final position of the MLD point, and will be explained later. C is a single character, which will only be 'T' or 'F'. If 'T' we need to turn the cloth 180 degrees about the y-axis, that is, make the x coordinate of each vertex -x. If 'F', nothing has to be done. A gives the angle by that we need to rotate counter-clockwise the cloth, based on the MLD point. Finally, we have to move, without any rotation, the cloth so that the MLD point is at the position of the point (X, Y). As you can see, we have to do some preprocesses as above about the cloth.

    You job is that, given the descriptions of two pieces of cloth, decide whether they intersect or not after all preprocesses.

    Input

    This problem has multiple test cases. In each test case, there are two pieces of descriptions in the given format, each for a piece of cloth. It is guaranteed that, there are at least 3 and at most 10 vertices of a cloth, and all coordinates in the input are integers not less than -10000 and not larger than 10000, the rotating angle is given in degree and will be between 0 and 360 degrees, inclusively.

    There is a blank line after each test case.

    The last test case is followed by a zero, which will not be processed.

    Output

    Print one line of string "Yes" if they intersect or "No" otherwise.

    Sample Input

    4
    2 0
    0 0
    0 2
    2 2
    0 0 F 0
    4
    2 0
    0 0
    0 2
    2 2
    1 1 F 0

    0

    Sample Output

    YES

    Source

    样例输入

    4
    2 0
    0 0
    0 2
    2 2
    0 0 F 0
    4
    2 0
    0 0
    0 2
    2 2
    1 1 F 0

    0

    样例输出

    YES

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部