为什么的深搜一直不对了,先贴着以后在弄把
2011-10-20 21:38
316 查看
Crank | ||
| ||
description | ||
Chev Chelios had his heart stolen from him, by the boss of the most dangerous gang in the city. His heart has been replaced with an artificial chargeable one! Chelios was on mission of locating the boss of the gang to get his heart back since then without luck! Now the artificial heart’s battery lifetime is about to expire! Fortunately, he finally located the target but he needs your help to get there before his artificial heart stops beating! Chelios decided to attack the boss building from the roof because all gates are heavily protected by gangsters. Chelios has the map of the gang block which shows the heights of all buildings within the block. The plan is that a helicopter will drop Chelios on the roof of one of the buildings on the boundary of the block during night. Then Chelios will get to the boss building by moving to adjacent buildings, vertically or horizontally. Chelios can only move to a building which has the same or smaller height as the current building (going up severely affects his damaged heart).Given the gang building block map which shows the heights of all buildings in the block along with the boss building, write a program to help Chev Chelios determine the number of buildings on the boundary of the block he can be dropped by the helicopter at so that he would be able to reach the boss’s building without climbing! | ||
input | ||
The first line of input contains an integer T, the number of test cases. T test cases follow, the first line of each test case contains two integers (1 <= R,C <= 10) the height and width of the building block. The second line contains two integers (1 <= A <= R), and (1 <= B <= C), the coordinates of the boss building on the map. R lines follows; each line consists of C space separated integers representing the heights of all buildings. A height H of a building satisfies (1 <= H <= 1000). | ||
output | ||
For each test case, print the number of buildings on the boundary of the block Chev Chelios can be dropped by the helicopter at so that he would be able to reach the boss’s building without climbing up! Follow the output format below. | ||
sample_input | ||
2 3 3 2 2 1 7 3 2 6 3 3 5 4 2 2 2 1 2 7 2 6 | ||
sample_output | ||
Case #1: 1 Case #2: 4 |
相关文章推荐
- 毕设 !!!(红色代码为电机控制,为什么按下按键电机转动一段时间以后,自己又停了呢,理论上不按停止应该一直转啊???!!!)
- 一直忙于教育工作,以后会定期更新BLOG的。谢谢大家支持和关注。
- 为什么不少朋友借钱后一直拖着不还?
- 作为程序员为什么一直都很努力,却没有进步?
- 为什么xmlhttp.readyState一直是1?
- 为什么在头部加上标签以后里面的href属性会影响到页面显示效果
- PKU-1002使用java编写用快速排序为何一直Runtime Error 无解 留下问题 以后再看
- 01背包,最基础的,看着模板敲的,交上还错了5次,不懂为什么用C交就不对呢。还是不懂
- DropBox为什么一直那么红——靠用户体验,旗帜鲜明,它要保存的是你的重要随身资料,并且开放API
- 为什么耗资数亿的12306一直都非常难用?
- [转载] 杜拉拉升职记——30 我保证以后一直对你好
- 为什么Google能一直领先?
- 为什么你一直找不到工作:因为你什么都想学,什么都不会!
- 我眼中的大神精神(之前所写,一直没有完成,以后慢慢完成)
- 优步uber司机申请了为什么一直没有通过审核,帐号也显示未激活
- 最近两次安装系统以后qq一直不能启动
- 编程之美格格取数(为什么一直是WA,求测试)
- 用Verilog编写时,always@(a,b,posedge cp) 为什么不对啊?正确的应该怎么写?
- 为什么你一直没有成就?
- 帮帮忙了,我是初学者在学习Struts2时关于文件上传时的错误,不知道怎么去改了,让我花费一下午的时间还是不对,一直提示我配置不对