1001. Robot
来源:互联网 发布:touch炫舞刷vip软件 编辑:程序博客网 时间:2024/06/17 21:22
Karell Incorporated has designed a new exploration robot that has the ability to explore new terrains, this new robot can move in all kinds of terrain, it only needs more fuel to move in rough terrains, and less fuel in plain terrains. The only problem this robot has is that it can only move orthogonally, the robot can only move to the grids that are at the North, East, South or West of its position.
The Karell`s robot can communicate to a satellite dish to have a picture of the terrain that is going to explore, so it can select the best route to the ending point, The robot always choose the path that needs the minimum fuel to complete its exploration, however the scientist that are experimenting with the robot, need a program that computes the path that would need the minimum amount of fuel. The maximum amount of fuel that the robot can handle is 9999 units
The Terrain that the robot receives from the satellite is divided into a grid, where each cell of the grid is assigned to the amount of fuel the robot would need to pass thought that cell. The robot also receives the starting and ending coordinates of the exploration area.
![](http://www.soj.me/UserFiles/8952/1004_1.gif)
The first line of the input file is the number of tests that must be examined.
The first line of the test is the number of rows and columns that the grid will contain. The rows and columns will be 0 < row100 , 0 <column
100
The next lines are the data of the terrain grid
The last line of the test has the starting and ending coordinates.
One line, for each test will have the amount of fuel needed by the robot
35 51 1 5 3 24 1 4 2 63 1 1 3 3 5 2 3 1 22 1 1 1 11 1 5 5 5 42 2 15 15 1 15 15 3 10 15 2 1 1 8 13 2 151 1 1 4 10 101 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 10
101519
- 1001. Robot
- Robot
- robot
- robot
- Robot
- Robot
- Mobile Robot
- Simulation Robot
- web robot
- Web Robot
- gtalk robot
- robot.txt
- 1321. Robot
- Robot Motion
- 1321. Robot
- Robot畅想曲
- Robot Motion
- Robot Framework
- 求给定数组中最大值和其在数组中的索引并输出
- 更改Chrome Developer Tools的字体
- 1000. Campus
- 面向对象编程中的聚合与耦合
- MFC 网络编程
- 1001. Robot
- hibernate.current_session_context_class
- 1002. Highways
- Java Socket常见异常处理
- xcode5设置LaunchImage
- 2014年MCM美国大学生数学建模——From my perspective
- 小白学习node.js的心得
- 新建了一个工作站,欢迎大家吐槽啊!
- Java Socket常见异常处理