《Dream of the Red Chamber》(also 《The Story of the Stone》) is one of the Four Great Classical Novels of Chinese literature, and it is commonly regarded as the best one. This novel was created in Qing Dynasty, by Cao Xueqin. But the last 40 chapters of the original version is missing, and that part of current version was written by Gao E. There is a heart breaking story saying that after Cao Xueqin died, Cao's wife burned the last 40 chapter manuscript for heating because she was desperately poor. This story was proved a rumor a couple of days ago because someone found several pages of the original last 40 chapters written by Cao.
In the novel, Wang Xifeng was in charge of Da Guan Yuan, where people of Jia family lived. It was mentioned in the newly recovered pages that Wang Xifeng used to arrange rooms for Jia Baoyu, Lin Daiyu, Xue Baochai and other teenagers. Because Jia Baoyu was the most important inheritor of Jia family, and Xue Baochai was beautiful and very capable , Wang Xifeng didn't want Jia Baoyu to marry Xue Baochai, in case that Xue Baochai might take her place. So, Wang Xifeng wanted Baoyu's room and Baochai's room to be located at two ends of a road, and this road should be as long as possible. But Baoyu was very bad at directions, and he demanded that there could be at most one turn along the road from his room to Baochai's room, and if there was a turn, that turn must be ninety degree. There is a map of Da Guan Yuan in the novel, and redists (In China English, one whose job is studying 《Dream of the Red Chamber》is call a "redist") are always arguing about the location of Baoyu's room and Baochai's room. Now you can solve this big problem and then become a great redist.
The map of Da Guan Yuan is represented by a matrix of characters '.' and '#'. A '.' stands for a part of road, and a '#' stands for other things which one cannot step onto. When standing on a '.', one can go to adjacent '.'s through 8 directions: north, north-west, west, south-west, south, south-east,east and north-east.
There are several test cases.
For each case, the first line is an integer N(0<N<=100) ,meaning the map is a N × N matrix.
Then the N × N matrix follows.
The input ends with N = 0.
For each test case, print the maximum length of the road which Wang Xifeng could find to locate Baoyu and Baochai's rooms. A road's length is the number of '.'s it includes. It's guaranteed that for any test case, the maximum length is at least 2.
- 学院 程序员的兼职技能课
- 学院 Windows版YOLOv4目标检测实战：训练自己的数据集
- 下载 lena全身原图(非256*256版本,而是全身原图)
- 学院 快速入门Android开发 视频 教程 android studio
- 博客 Java调用微信支付
- 下载 汽车租赁管理系统需求分析规格说明书
- 学院 程序员的算法通关课：知己知彼（第一季）
- 学院 机器学习初学者必会的案例精讲
- 学院 Python入门视频精讲
- 博客 我以为我对Mysql事务很熟，直到我遇到了阿里面试官
- 下载 Java62数据提取代码
- 博客 Python代码实现飞机大战
- 下载 2018年全国大学生计算机技能应用大赛决赛 大题
- 下载 Lena图像处理测试专业用图，高清完整全身原图
- 博客 MySQL数据库面试题（2020最新版）
- 下载 verilog实现地铁系统售票
- 学院 Python+OpenCV计算机视觉
- 学院 Python可以这样学（第四季：数据分析与科学计算可视化）
- 学院 150讲轻松搞定Python网络爬虫
- 下载 获取Linux下Ftp目录树并逐步绑定到treeview
- 学院 手把手实现Java图书管理系统（附源码）
- 学院 微信小程序开发实战之番茄时钟开发
- 博客 Java 最常见的 200+ 面试题：面试必备
- 博客 Java基础知识面试题（2020最新版）
- 学院 三个项目玩转深度学习（附1G源码）
- 下载 微信小程序 实例汇总 完整项目源代码
- 下载 基于西门子S7—1200的单部六层电梯设计程序，1部6层电梯