540C: Ice Cave】的更多相关文章

题目链接 题意: n*m的地图,'X'表示有裂痕的冰块,'.'表示完整的冰块,有裂痕的冰块再被踩一次就会碎掉,完整的冰块被踩一次会变成有裂痕的冰块, 现在告诉起点和终点,问从起点能否走到终点并且使终点的冰块碎掉.不能原地跳.起点和终点可能会在同一个位置. 解题思路: 在只走'.'的情况下把终点的冰踩碎   输入n*m的矩阵 以及走的开始和终点位置 在开始点,上下左右找'.',有就走,并把改点设置为'X',走到终点时候,若终点是'X'则成功. 其他情况都失败.   这个程序是在codeforces…
C:Ice Cave 有一个m*n的地图,里面包含'.'表示完整的冰块,'X'表示有裂痕的冰块,当游戏者到达完整的冰块时,这个位置的冰块会变成有裂痕的冰块,如果到达有裂痕的冰块时,游戏者会进入下一关 现在给你当前位置和终点,每次移动都是相邻位置互相移动:问游戏者能不能从终点位置进入下一关:起始位置是由上一关下来的,所以都是‘X’ bfs 注意下标是从1开始:  …
http://codeforces.com/problemset/problem/540/C       Ice Cave Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 540C Description You play a computer game. Your character stands on some lev…
题目链接:https://vjudge.net/contest/226823#problem/C You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through t…
http://codeforces.com/problemset/problem/540/C You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through the…
题目传送门 /* 题意:告诉起点终点,踩一次, '.'变成'X',再踩一次,冰块破碎,问是否能使终点冰破碎 DFS:如题解所说,分三种情况:1. 如果两点重合,只要往外走一步再走回来就行了:2. 若两点相邻, 那么要不就是踩一脚就破了或者踩一脚走开再走回来踩一脚破了:3. 普通的搜索看是否能到达, 若能还是要讨论终点踩几脚的问题:) DFS 耗时大,险些超时,可以用BFS来做 */ #include <cstdio> #include <algorithm> #include &l…
C. Ice Cave Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/540/problem/C Description You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend…
Description You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through the ice. The level of the cave where y…
Description You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through the ice. The level of the cave where y…
题意:给定 n * m的矩阵,让你并给定初始坐标和末坐标,你只能走'.',并且走过的'.'都会变成'X',然后问你能不能在末坐标是'X'的时候走进去. 析:这个题,在比赛时就是没做出来,其实是一个水题,但是我理解错了意思,让下面提示的第一组样例给搞乱. 思路应该是这样的,从开始坐标BFS末坐标,把经过的都标成'X',如果直到末坐标是'.',接着走,如果能直到末坐标是'X',就是可以,否则就是不可以. 代码如下: #include <bits/stdc++.h> using namespace…