若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。


  • 运维

  • 前端

  • 编程

  • 随笔

  • hust-oj

1085: Maze Problem

发表于 2017-10-06   |   分类于 HUSTOJ   |   阅读次数 1,276

题目描述

Given a maze, find a shortest path from start to goal.

输入

Input consists serveral test cases.
First line of the input contains number of test case T.
For each test case the first line contains two integers N , M ( 1 <= N, M <= 100 ).
Each of the following N lines contain M characters. Each character means a cell of the map.
Here is the definition for chracter.
 
Constraint:

For a character in the map:

'S' : start cell
'E' : goal cell
'-' : empty cell
'#' : obstacle cell

no two start cell exists.
no two goal cell exists.

输出

For each test case print one line containing shortest path. If there exists no path from start to goal, print -1.

样例输入

1
5 5
S-###
-----
##---
E#---
---##

样例输出

9

参考代码

#include<stdio.h>
void main() 
{
    int a;
    char b;
    while(scanf("%d",&a)!=EOF) 
    {
        b=a;
        printf("%c",b);
    }
}

解析

暂无

hustoj

发表评论 取消回复

电子邮件地址不会被公开。 必填项已用*标注

*
*


hoxis wechat
著作权归作者所有
站点更新说明
  • 文章目录
  • 站点概览
若是凉夜已成梦

若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。

1904 日志
6 分类
12 标签
RSS
weibo github twitter facebook

友情链接

Dreams孤独患者 Skip 原站点
© 2017 若是凉夜已成梦
Powered by WordPress | 已运行
Theme By NexT.Mist