搜索
文章平均质量分 54
fantaticmen
如果有讲的不详细的或者错误的可以加鹅细聊+934591874
展开
-
BFS深度优先搜索 炸弹人
题面:一个人在一个坐标放炸弹,请问可以可以杀死的敌人数目最大是,并且输出该点的坐标 G代表敌人 .代表该位置可以走 “#”代表该位置存在障碍物 并且防止炸弹的蔓13 13 3 3 .############# .#GG.GGG#GGG.# .###.#G#G#G#G# .#…….#..G# .#G#.###.#G#G# .#GG.GGG.#.GG# .#G#.#G#.#.#.#原创 2017-04-23 17:58:29 · 432 阅读 · 0 评论 -
hdu 4506 快速幂
小明自从告别了ACM/ICPC之后,就开始潜心研究数学问题了,一则可以为接下来的考研做准备,再者可以借此机会帮助一些同学,尤其是漂亮的师妹。这不,班里唯一的女生又拿一道数学题来请教小明,小明当然很高兴的就接受了。不过等他仔细读题以后,发现自己也不会做,这下小明囧了:如果回复说自己不懂,岂不是很没面子? 所以,他现在私下求你帮忙解决这道题目,题目是这样的: 给你n个数字,分别是a1,a原创 2017-07-19 19:10:56 · 360 阅读 · 0 评论 -
zoj 1649 bfs
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.Angel’s friends want to save原创 2017-07-19 19:07:29 · 302 阅读 · 0 评论 -
hdu 1518 BFS
Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? Input The first line of input contains N, the number of test cases. Each test case begins with an i原创 2017-07-19 19:03:56 · 276 阅读 · 0 评论 -
hdu 1372 BFS
A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboar原创 2017-07-19 19:02:02 · 361 阅读 · 0 评论 -
zoj 1940 模拟三维bfs
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 move one unit north, south,原创 2017-07-20 20:55:58 · 437 阅读 · 0 评论 -
zoj 2100 DFS
It is spring time and farmers have to plant seeds in the field. Tom has a nice field, which is a rectangle with n * m squares. There are big stones in some of the squares. Tom has a seeding-machine. A原创 2017-07-20 20:52:22 · 315 阅读 · 0 评论 -
zoj 3158 DFS
Li Lei and Han Meimei love each other so much that they can not be separated for even one minute. They have promised each other to share all the happy things and delicious foods. In the Saint Valentine原创 2017-07-20 20:50:26 · 433 阅读 · 0 评论 -
zoj 2110 奇偶性剪枝
The 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 realized that the bone w原创 2017-07-20 20:46:22 · 439 阅读 · 0 评论 -
算法提高 排列数
时间限制:1.0s 内存限制:256.0MB 提交此题 问题描述 0、1、2三个数字的全排列有六种,按照字母序排列如下: 012、021、102、120、201、210 输入一个数n 求0~9十个数的全排列中的第n个(第1个为0123456789)。 输入格式 一行,包含一个整数n 输出格式 一行,包含一组10个数字的全排列 样例输入 1 样例输原创 2017-03-21 22:18:54 · 361 阅读 · 0 评论 -
基础练习 2n皇后问题
时间限制:1.0s 内存限制:512.0MB 提交此题 锦囊1 锦囊2 问题描述 给定一个n*n的棋盘,棋盘中有一些位置不能放皇后。现在要向棋盘中放入n个黑皇后和n个白皇后,使任意的两个黑皇后都不在同一行、同一列或同一条对角线上,任意的两个白皇后都不在同一行、同一列或同一条对角线上。问总共有多少种放法?n小于等于8。 输入格式 输入的第一行为一个整数n,表示棋盘的大小。原创 2017-03-21 22:21:02 · 377 阅读 · 0 评论 -
算法提高 8皇后·改
时间限制:1.0s 内存限制:256.0MB 提交此题 问题描述 规则同8皇后问题,但是棋盘上每格都有一个数字,要求八皇后所在格子数字之和最大。 输入格式 一个8*8的棋盘。 输出格式 所能得到的最大数字和 样例输入 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27原创 2017-03-21 22:22:39 · 635 阅读 · 0 评论 -
BFS广度优先搜索 poj1915
Knight Moves Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 25909 Accepted: 12244 DescriptionBackground Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else原创 2017-04-21 22:12:06 · 351 阅读 · 0 评论 -
BFS广度优先搜索 炸弹人
题面:一个人在一个坐标放炸弹,请问可以可以杀死的敌人数目最大是,并且输出该点的坐标 G代表敌人 .代表该位置可以走 “#”代表该位置存在障碍物 并且防止炸弹的蔓13 13 3 3 .############# .#GG.GGG#GGG.# .###.#G#G#G#G# .#…….#..G# .#G#.###.#G#G# .#GG.GGG.#.GG# .#G#.原创 2017-04-23 17:59:58 · 535 阅读 · 0 评论 -
poj 2386 bfs
DescriptionDue 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 square contains eith原创 2017-08-04 04:48:02 · 454 阅读 · 0 评论