琪露诺的冰雪小屋

题目背景

琪露诺有一片正方形的雪地,她想在上面盖一栋小冰屋。

题目描述

琪露诺偶然间得到了一片n\*n大小的正方形的雪地,她想在上面盖一栋冰雪小屋。 但调皮的⑨才不会认真地收集冰块呢,她要在这片土地上使用冰雪弹幕来制造冰砖,然后一块一块地搭起一个房子。 琪露诺制造冰砖的方式是这样的:她会站在某个方格上,然后向上,下,左,右,左上,左下,右上,右下这八个方向之一发射强力的冰雪弹幕,弹幕能影响到该方向一条直线上一定的距离以内的所有方格。 地面的每个方格都有一个冷冻度,初始为0。被冰雪弹幕影响一次,冷冻度+1,冷冻度的上限为4。 在发射弹幕的间隙中,琪露诺会来到所有冷冻度为4的格子,把那里的雪堆到一起,制作一个冰砖(大小为1\*1\*1方格),并且将冷冻度重新归零。 琪露诺会拿着这些冰砖来盖房子。这个房子的长度、宽度和坐落位置她在一开始就已经规划好了,但她并不愿意提早确定房子的高度。 琪露诺是这样计划的:这个房子外观上看起来是一个长方体。 她会先盖起这个房子的四面墙(厚度为1个方格),并在贴近地面的位置(废话)留一个宽度和高度分别为1和2的空位不放冰砖,作为房门。(显然,门无法开在墙的拐角处,但可以紧贴拐角)。 在她喜欢的时候,她会结束四面墙的建造,并一次性在墙顶部盖上一个厚度为1方格的屋顶,使房子成为一个空心有顶的长方体。 计划已经非常充分了,但琪露诺还是不放心,所以她想请你帮她写一个程序,来随时提醒着她别出什么差错。这个程序需要具备的功能将在下文详细介绍。 (由于题目长度过长,题面剩余部分用图片的形式呈现) ![](https://cdn.luogu.com.cn/upload/pic/4770.png) ![](https://cdn.luogu.com.cn/upload/pic/4771.png) ![](https://cdn.luogu.com.cn/upload/pic/4772.png) ![](https://cdn.luogu.com.cn/upload/pic/4773.png) ![](https://cdn.luogu.com.cn/upload/pic/4774.png) ![](https://cdn.luogu.com.cn/upload/pic/4775.png) ![](https://cdn.luogu.com.cn/upload/pic/4776.png) ![](https://cdn.luogu.com.cn/upload/pic/4777.png) ![](https://cdn.luogu.com.cn/upload/pic/4778.png) ![](https://cdn.luogu.com.cn/upload/pic/4779.png) ![](https://cdn.luogu.com.cn/upload/pic/4780.png) ![](https://cdn.luogu.com.cn/upload/pic/4781.png) ![](https://cdn.luogu.com.cn/upload/pic/4782.png) ![](https://cdn.luogu.com.cn/upload/pic/4783.png) ![](https://cdn.luogu.com.cn/upload/pic/4784.png) ![](https://cdn.luogu.com.cn/upload/pic/4785.png) ![](https://cdn.luogu.com.cn/upload/pic/4786.png) ![](https://cdn.luogu.com.cn/upload/pic/4787.png) ![](https://cdn.luogu.com.cn/upload/pic/4788.png)

输入输出格式

输入格式


第一行一个正整数N,表示雪地的大小。 第二行一个正整数HM,表示琪露诺放置方块的最大高度 第三行四个正整数HR,HC,HX,HY,表示房子左上角位置的行列坐标,房子的长度以及宽度。 第四行一个正整数M,表示操作的数量 接下来M行,每行表示一个操作,输入格式见题目描述。

输出格式


在题目描述中已经介绍。

输入输出样例

输入样例 #1

8
10
4 0 4 4
63
ICE_BARRAGE 2 1 1 3
ICE_BARRAGE 0 1 3 1
MAKE_ICE_BLOCK
PUT_ICE_BLOCK 3 2 0
ICE_BARRAGE 1 0 6 7
ICE_BARRAGE 2 0 6 7
ICE_BARRAGE 3 0 6 7
ICE_BARRAGE 4 0 6 7
ICE_BARRAGE 1 0 6 7
ICE_BARRAGE 1 0 6 7
ICE_BARRAGE 1 0 6 7
ICE_BARRAGE 1 0 6 7
MAKE_ICE_BLOCK
PUT_ICE_BLOCK 4 0 1
PUT_ICE_BLOCK 4 0 0
PUT_ICE_BLOCK 4 0 1
PUT_ICE_BLOCK 3 0 1
REMOVE_ICE_BLOCK 4 0 1
PUT_ICE_BLOCK 4 2 0
PUT_ICE_BLOCK 6 1 0
PUT_ICE_BLOCK 4 3 0
PUT_ICE_BLOCK 5 3 0
PUT_ICE_BLOCK 6 3 0
PUT_ICE_BLOCK 7 3 0
ICE_BARRAGE 0 1 4 7
ICE_BARRAGE 1 0 6 7
ICE_BARRAGE 1 0 6 7
IC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O,CAN'T PUT HERE
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 7 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 6 ICE_BLOCK(S)
CIRNO MISSED THE PLACE
CIRNO REMOVED AN ICE_BLOCK,AND 1 BLOCK(S) ARE BROKEN
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 5 ICE_BLOCK(S)
CIRNO PUT AN ICE_BLOCK INSIDE THE HOUSE
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 3 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 2 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 1 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 0 ICE_BLOCK(S)
CIRNO FREEZED 6 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 7 BLOCK(S)
CIRNO MADE 8 ICE BLOCK(S),NOW SHE HAS 8 ICE BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO MADE 8 ICE BLOCK(S),NOW SHE HAS 16 ICE BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO MADE 8 ICE BLOCK(S),NOW SHE HAS 24 ICE BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO FREEZED 8 BLOCK(S)
CIRNO MADE 8 ICE BLOCK(S),NOW SHE HAS 32 ICE BLOCK(S)
CIRNO REMOVED AN ICE_BLOCK
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 32 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 31 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 30 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 29 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 28 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 27 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 26 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 25 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 24 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 23 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 22 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 21 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 20 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 19 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 18 ICE_BLOCK(S)
CIRNO SUCCESSFULLY PUT AN ICE_BLOCK,NOW SHE HAS 17 ICE_BLOCK(S)
0 ICE_BLOCK(S) INSIDE THE HOUSE NEED TO BE REMOVED
0 ICE_BLOCK(S) OUTSIDE THE HOUSE NEED TO BE REMOVED
GOOD JOB CIRNO,SUCCESSFULLY BUILT THE HOUSE
DOOR IS OK
WALL IS OK
CORNER IS OK
CIRNO FINALLY HAS 1 ICE_BLOCK(S)
CIRNO IS PERFECT!

说明

共分为6个subtask,每个subtask的数据都满足一定条件,并且同时满足序号更大的subtask的条件。 如subtask1同时满足subtask1~6的条件。 每一个subtask的得分取所有测试点的最低分 subtask1- 20% 琪露诺只想玩玩冰雪弹幕,她不会放置任何冰砖,也不会盖房子。 (即只有操作一和操作二) subtask2- 10% 琪露诺不会移除已经放置的冰砖 subtask3 -20% 琪露诺很有信心,她将在没有MAKE\_ROOF的情况下建造她的冰屋(这种情况下,放置方块的高度仍然会小于HM)。 (没有MAKE\_ROOF操作) subtask4 -20% 琪露诺在移除方块时会谨慎考虑,不会造成任何冰砖摔落。 MAKE\_ROOF操作移除多余冰砖时,也不会造成屋顶塌陷。 subtask5- 20% 琪露诺不喜欢把门开到四角的柱子旁边。 (数据保证在所有可能作为门的墙壁空缺中,有一种可能使得 门不紧贴四角的柱子) subtask6- 10% 4<=N<=16 5<=HM<=20 10<=M<=1000 保证不属于冰屋范围内的所有空地至多构成一个连通块。 注意:判断墙壁是否有残缺时,候选的开门位如果被方块堵住,在当时还未被清空。"能看到残缺"以当时的情况作为判断依据。