- 博客(9)
- 资源 (1)
- 收藏
- 关注
原创 迷宫问题 (广搜并记录路径)
迷宫问题定义一个二维数组: 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表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数...
2017-09-28 19:30:48 583
原创 Oil Deposits (简单深搜)积水问题
Oil Deposits The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates
2017-09-26 20:25:19 1426
原创 Dungeon Master (简单广搜)三维地下城
Dungeon Master You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to m
2017-09-26 20:19:05 376
原创 Catch That Cow (经典广搜入门题)
Catch That Cow #include#include#include#include#define MAXN 1000001using namespace std;int ret[MAXN],vis[MAXN];queue p;int bfs(int n,int k){ int cur; if(n==k) return 0; p.push
2017-09-26 08:48:45 832
原创 Lake Counting (简单深搜)积水问题
Lake Counting Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle of N x M (1 <= N <= 100; 1 <= M <= 100) squares. Each...
2017-09-23 22:03:02 660
原创 棋盘问题(简单深搜)
棋盘问题在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8...
2017-09-23 12:40:34 460
转载 大数(转自http://blog.csdn.net/zz_1215/article/details/6716132)
#define DIGIT 4 //四位隔开,即万进制#define DEPTH 10000 //万进制#define MAX 10 //题目最大位数/4,要不大直接设为最大位数也行typedef int bignum_t[MAX+1];/****************************************************
2017-09-16 14:32:42 370
转载 A + B Problem II(大数加法hd1002)
Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the input contains an integer T(1<=T<
2017-09-16 08:39:51 202
转载 多数组排序(如今年暑假不ac)
当多个数组有关时 比如今年暑假不AC中的测试案例,可以通过构建结构体来进行排序这是模板:#include #include #include #include #include using namespace std; const int maxn=100006; struct Node { int l; int r
2017-09-10 20:04:28 157
数据结构课程设计-检查网络
2018-10-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人