Pro.ID10202 TitleWindow Area Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10202 AC2 Submit2 Ratio100.00% 时间&空间限制描述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:
In the input, the operations appear in the following format:
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:
In the input, the operations appear in the following format:
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) Sample Output 49.167 Source 样例输入w(a,10,132,20,12) 样例输出49.167 作者 |