定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能斜着走,要求编...
分类:
其他好文 时间:
2015-04-04 18:20:19
阅读次数:
126
Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He reali...
分类:
其他好文 时间:
2015-04-02 09:12:26
阅读次数:
142
A题:有一个n*n的矩阵,矩阵的第一行和第一列的值都为1,其余的有:a[i][j]=a[i-1][j]+a[i][j-1];现在给出一个n求出这个n*n的矩阵中最大的数。显然,最大的数就是a[n][n]。因为n 2 int maze[11][11]; 3 int main() 4 { 5 f...
分类:
其他好文 时间:
2015-04-01 14:47:09
阅读次数:
168
11624 Fire!Joe works in a maze. Unfortunately, portions of the maze have caughton fire, and the owner of the maze neglecte...
分类:
其他好文 时间:
2015-03-31 00:44:34
阅读次数:
207
DFS就可以解决,只要想到要向四个方向搜索就可以解决了,很多写法,最直白的就是不断判断,然后判断....
注意:特别注意输入的两个变量,全程小心!!!!
#include
#include
using namespace std;
int n, m,ans;
char maze[21][21];
bool vised[21][21];
//查找从(x,y)开始的可以移动的黑点的数量...
分类:
其他好文 时间:
2015-03-30 23:08:40
阅读次数:
202
题目大意:
题目太长了,简单的意思就是:有N个魔杖,M个魔法师,魔杖有多个匹配的魔法师。但是一个魔法师
只能对应一根魔杖。那么问题来了:最多有多少魔法师能得到魔棒。
思路:
做一个二分图,一边是魔杖,另一边是魔法师。相应的匹配作为二分图的边。利用匈牙利算法,求出二
分图最大匹配是多少。...
分类:
其他好文 时间:
2015-03-30 11:19:23
阅读次数:
159
9017. Amazing Mazes
Constraints
Time Limit: 1 secs, Memory Limit: 256 MB
Description
You are requested to solve maze problems. Without passing through these mazes, you ...
分类:
其他好文 时间:
2015-03-30 09:18:21
阅读次数:
188
图的转化,想了N久没想出来,看了题解发现自己其实想的差不多了,但是想多了(ORZ流泪)
把图扩大两倍(就是一个斜杠占2个位置)
走8个发现,走斜对角的时候需要特判
写完一次就AC了
#include
#include
#include
using namespace std;
const int maxn = 80;
const int maxd = 222;
const int dir[...
分类:
其他好文 时间:
2015-03-21 18:41:11
阅读次数:
140
Beam me out!King Remark, first of his name, is a benign ruler and every wrongdoer gets a second chance after repenting his crimes in the Great Maze!To...
分类:
其他好文 时间:
2015-03-20 20:24:09
阅读次数:
154
#include
using namespace std;
#define INF 0x7ffffff
#define maxn 105
typedef pair P;
int dp[maxn][maxn], n, m;
char maze[maxn][maxn];
int sx, sy, ex, ey;
int go[4][2] = {{-1,0},{1,0},{0,-1},{0,1}...
分类:
其他好文 时间:
2015-03-14 16:58:43
阅读次数:
123