bfs
绝不挂科
这个作者很懒,什么都没留下…
展开
-
第四天-G-POJ-3414
POJ-3414-BFS+路径输出 You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap; DROP(i) ...原创 2019-01-26 20:32:13 · 121 阅读 · 0 评论 -
第三次-H-poj-3126-BFS+打表
poj-3126 The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matt...原创 2019-01-26 23:32:47 · 135 阅读 · 0 评论 -
第六天-H-hdu-1495
hdu-1495 题解: 然后每种状态里面又分两种不同情况,可以将此瓶的水全部清空,不能清空… 现在要求最少经过多少步就能平分那么多水 首先剪枝是 如果s是奇数必然不行。 一看到要求最少的步数就知道用bfs了 我们用vis标记状态 每个状态有三个整数组成 表示这三个杯子里的可乐数量 然后对每个状态的递推是 6种 也就是3!种。从一个到到另一个 再标记 入队 emmm这也是别人的题解 #includ...原创 2019-01-29 19:24:44 · 102 阅读 · 0 评论 -
POJ-2251-bfs
题目链接: poj-2251 这个题目的难度在于三维空间,不好去理解题意,分析去它的坐标变化,然后用结构体,三维数组,队列去处理,问题就好办多了! #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; char map[...原创 2019-03-01 19:43:33 · 128 阅读 · 0 评论