10202_WindowArea

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

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

Pro.ID

10202

Title

Window Area

Title链接

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

AC

2

Submit

2

Ratio

100.00%

时间&空间限制

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

    You've just be assigned the project of implemented a windowing interface. This windowing interface is fairly simple, and fortunately, you don't have to display the actual windows. There are 5 basic operations:

    1. Create a window

    2. Bring a window to the top

    3. Put a window to the bottom

    4. Destroy a window

    5. Output what percentage of a window is visible (i.e., isn't covered by windows above it).

    In the input, the operations appear in the following format:

    • Create window: w(I,x,y,X,Y)

    • Bring window to top: t(I)

    • Put window on bottom: b(I)

    • Destroy window: d(I)

    • Output percentage visible: s(I)

    The I is a unique identifier for each window, which is one character. The character can be any of 'a'..'z', 'A'..'Z', and '0'..'9'. No extra spaces will appear in the input.

    (x,y) and (X,Y) are opposite corners of the window. When a window is created, it is put 'on top'. You can't create a window with an identifier that is already in use, but you can destroy a window and then create a new one with the identifier of the destroyed window. Coordinates will be positive integers, and all windows will be of non-zero area (x ≠ X and y ≠ Y). The x and y coordinates are between 1 and 32767 inclusive.

    输入

    The input file consists of a sequence of commands to your interpreter. They will be listed one per line. Terminate the program when no more input is available

    输出

    Description

    You've just be assigned the project of implemented a windowing interface. This windowing interface is fairly simple, and fortunately, you don't have to display the actual windows. There are 5 basic operations:

    1. Create a window

    2. Bring a window to the top

    3. Put a window to the bottom

    4. Destroy a window

    5. Output what percentage of a window is visible (i.e., isn't covered by windows above it).

    In the input, the operations appear in the following format:

    • Create window: w(I,x,y,X,Y)

    • Bring window to top: t(I)

    • Put window on bottom: b(I)

    • Destroy window: d(I)

    • Output percentage visible: s(I)

    The I is a unique identifier for each window, which is one character. The character can be any of 'a'..'z', 'A'..'Z', and '0'..'9'. No extra spaces will appear in the input.

    (x,y) and (X,Y) are opposite corners of the window. When a window is created, it is put 'on top'. You can't create a window with an identifier that is already in use, but you can destroy a window and then create a new one with the identifier of the destroyed window. Coordinates will be positive integers, and all windows will be of non-zero area (x ≠ X and y ≠ Y). The x and y coordinates are between 1 and 32767 inclusive.

    Input

    The input file consists of a sequence of commands to your interpreter. They will be listed one per line. Terminate the program when no more input is available

    Output

    Output lines only for the s() commands. Of course, there might be several s() commands (but no more than 500) so the output should be a sequence of percentages, one per line, stating the percentage of the windows that are visible. The percentages should be rounded to 3 decimal places.

    Sample Input

    w(a,10,132,20,12)
    w(b,8,76,124,15)
    s(a)

    Sample Output

    49.167

    Source

    样例输入

    w(a,10,132,20,12)
    w(b,8,76,124,15)
    s(a)

    样例输出

    49.167

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部