题目
166:The Castle
总时间限制: 1000ms 内存限制: 65536kB
描述

Figure 1 shows the map of a castle.Write a program that calculates
- how many rooms the castle has
- how big the largest room is
The castle is divided into m * n (m<=50, n<=50) square modules. Each such module can have between zero and four walls.
输入
Your program is to read from standard input. The first line contains the number of modules in the north-south direction and the number of modules in the east-west direction. In the following lines each module is described by a number (0 <= p <= 15). This number is the sum of: 1 (= wall to the west), 2 (= wall to the north), 4 (= wall to the east), 8 (= wall to the south). Inner walls are defined twice; a wall to the south in module 1,1 is also indicated as a wall to the north in module 2,1. The castle

编程任务要求计算城堡房间数量与最大房间面积,通过遍历和宽度搜索算法实现。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



