CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程

文件名称:yuanma

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2015-12-13
  • 文件大小:
    1.28kb
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

现有一种格子迷宫,该迷宫由N行N列的格子构成。迷宫中有三种格子,第一种是墙壁,不能通过;第二种格子能正常通行,经过该格子可以到达与它相邻的上/下/左/右格子中;第三种格子除了具有第二种格子的功能外,它还具有“瞬间移动”功能,到达此格子后,可以选择是否瞬间被传送到给定的格子上。在一个由上述三种格子构成的迷宫中,给定起点和终点的位置,求从起点到达终点所需要的最小代价。

下图是一个3*3格子迷宫,该迷宫中2号格子具有的“瞬间移动”功能是能传送至8号格子,7号格子则是能传送至9号格子。





3*3迷宫示例



1 0(8) -1

2 1 2

0(9) 1 2



Input Descr iption





第一行:迷宫的规模N值 起点格子序号start 终点格子序号end



接下来的N*N行:依次按逐行扫描方式输入迷宫中序号为1至N*N的格子的代价值及跳转的格子序号M(如果有的话)。



Output Descr iption



输出从起点到达终点所需要的最小代价。这里需要注意的是,若从指定起点无法到达终点,则输出为INF(请在程序中宏定义为4字节int型变量表示的最大正数值,即为2147483647)。-Present a lattice maze, the labyrinth consists of a grid of N rows and N columns. There are three maze grid, the first one is a wall, you can not pass the second grid normal passage through the lattice can be reached with its adjacent up/down/left/right grid and the third grid in addition to a first two grid functions, it also has " teleport" feature, this lattice arrive, you can choose whether a given moment is transferred to the lattice. In the maze of a grid consisting of the three, given a start and end location, find the minimum cost required the beginning of the end arrives. The figure is a 3* 3 grid maze, the maze has a grid on the 2nd of " teleport" feature is capable of transmitting to the 8th grid, the grid is capable of transmitting the 7th to the 9th grid. Labyrinth Example 3* 3 1 0 (8)-1 2 1 2 0 (9) 1 2 Input Descr iption First line: the value of the starting point of the maze lattice size N number start end end The next grid numbers N* N lines: followe
(系统自动生成,下载前可以参看下载内容)

下载文件列表

源.cpp

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com