题目: There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can move only on black…
POJ 1979 Red and Black (红与黑) Time Limit: 1000MS Memory Limit: 30000K Description 题目描述 There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to…
HDU 1312 题目大意: 一个地图里面有三种元素,分别为"@",".","#",其中@为人的起始位置,"#"可以想象为墙,然后.为可以走的空地,求人可以走的最大点数. 解题思路:从起点开始,起点的四个方向满足条件的点分别入队(放置重复入队,需只要一入队就标记已访问而不是取出时再进行标记),直至队为空. /*HDU 1312 ----- Red and Black 入门搜索 BFS解法*/ #include <cstd…
HDU 1312 题目大意: 一个地图里面有三种元素,分别为"@",".","#",其中@为人的起始位置,"#"可以想象为墙,然后.为可以走的空地,求人可以走的最大点数. 解题思路:从起点开始,从4个方向进行递归遍历(已经访问的点进行标记). /*HDU 1312 ----- Red and Black 入门搜索 */ #include <cstdio> int n, m; //n行m列 int cnt, star…
HDU 1312:Red and Black Time Limit:1000MS Memory Limit:30000KB 64bit IO Format:%I64d & %I64u Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. F…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1312 Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17773 Accepted Submission(s): 10826 Problem Description There is a rectangula…
1.链接地址: http://bailian.openjudge.cn/practice/1979 http://poj.org/problem?id=1979 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile.…
Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 19731 Accepted Submission(s): 11991 Problem Description There is a rectangular room, covered with square tiles. Each tile is col…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1312 Red and Black Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25397 Accepted Submission(s): 15306 Problem Description There is a rectangula…
http://acm.hdu.edu.cn/showproblem.php?pid=1979 Fill the blanks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 373 Accepted Submission(s): 155 Problem Description There is a matrix of 4*4, yo…