POJ 3414 Pots 暴力,bfs 难度:1】的更多相关文章

http://poj.org/problem?id=3414 记录瓶子状态,广度优先搜索即可 #include <cstdio> #include <cstring> #include <queue> using namespace std; const int maxn=101; int n,m; typedef unsigned long long ull; int A,B,C; int vis[maxn][maxn]; int ans[maxn][maxn][ma…
//yy:昨天看着这题突然有点懵,不知道怎么记录路径,然后交给房教了,,,然后默默去写另一个bfs,想清楚思路后花了半小时写了120+行的代码然后出现奇葩的CE,看完FAQ改了之后又WA了.然后第一次用对拍去找特殊数据折腾到十二点半终于AC,最后只想感叹没有仔细读题,没办法啊看着英语略烦躁,不扯了,那个题题解不想写了,回到这题...今天中午还是花了四十分钟写了这题(好慢啊orz),感觉,啊为什么别人可以一下子就写出来,我却想不到怎么写呢!!! poj 3414 Pots  [BFS] 题意:两个…
题目地址:http://poj.org/problem?id=3414 Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12080   Accepted: 5104   Special Judge Description You are given two pots, having the volume of A and B liters respectively. The following operation…
链接: http://poj.org/problem?id=3414 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22009#problem/J Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8253   Accepted: 3499   Special Judge Description You are given two pots, havin…
题目:http://poj.org/problem?id=3414 题意:给出了两个瓶子的容量A,B, 以及一个目标水量C, 对A.B可以有如下操作: FILL(i)        fill the pot i (1 ≤ i ≤ 2) from the tap; DROP(i)      empty the pot i to the drain; POUR(i,j)    pour from pot i to pot j; after this operation either the pot…
题目链接 http://poj.org/problem?id=3414 题意 给出两个杯子 容量分别为 A B 然后给出C 是目标容量 有三种操作 1 将一个杯子装满 2.将一个杯子全都倒掉 3.将一个杯子的水倒到另一个杯子里面 如果某个杯子里面的水 能够达到 目标容量 那么就输出步骤 思路 BFS 并且要存储步骤 每一步一共有六步操作 记得标记 AC代码 #include <cstdio> #include <cstring> #include <ctype.h> #…
Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10071   Accepted: 4237   Special Judge Description You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i)        f…
Description 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)      empty the pot i to the drain; POUR(i,j)    pour from…
Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11705   Accepted: 4956   Special Judge Description You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: FILL(i)        f…
题目传送门 /* BFS:六种情况讨论一下,BFS轻松解决 起初我看有人用DFS,我写了一遍,TLE..还是用BFS,结果特判时出错,逗了好长时间 看别人的代码简直是受罪,还好自己终于发现自己代码的小错误:) */ /************************************************ Author :Running_Time Created Time :2015-8-3 14:17:24 File Name :POJ_3414_BFS.cpp ***********…