新的方法和概念,常常比解决问题本身更重要. ————华罗庚 引子 深度优先搜索(Deep First Search) 广度优先搜索(Breath First Search) 当菜鸟们(比如我)初步接触算法的时候,会接触这两种简单的盲目搜索算法,相较与其他众多的算法,这两种算法相对较好理解,运用范围也很广,在众多的学科竞赛里都可以见到它们的影子,话不多说,我们开始. 深度优先搜索(Deep First Search) 深度优先搜索算法(Depth First Search):一种用于遍历或搜索树或
[1559] Jump to the Top of Mountain 时间限制: 1000 ms 内存限制: 65535 K 问题描述 Have you played a game named Minecraft? In the game, there is a thing alloy you can not destroy, and its shape is a 1*1*1 area cube. I can only jump 1 meter at vertical height, it me
Problem H: Two EndsIn the two-player game “Two Ends”, an even number of cards is laid out in a row. On each card, faceup, is written a positive integer. Players take turns removing a card from either end of the row andplacing the card in their pile.
C. Love Triangles Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/553/problem/C Description There are many anime that are about "love triangles": Alice loves Bob, and Charlie loves Bob as well, but Alice hates Charlie.
题目大意:输入三个整数N,M,T.在接下来的N行.M列会有一系列的字符.其中S表示起点,D表示终点. .表示路 . X表示墙...问狗能有在T秒时到达D.如果能输出YES, 否则输出NO 解题思路:DFS+剪枝 代码如下: /* * 1010_3.cpp * * Created on: 2013年8月16日 * Author: Administrator */ #include <iostream> using namespace std; bool flag; int N, M, T; in