Pots(bfs)】的更多相关文章

Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8266   Accepted: 3507   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)        fill th…
Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu 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…
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…
http://poj.org/problem?id=3414                                       Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9996   Accepted: 4198   Special Judge Description You are given two pots, having the volume of A and B liters respe…
Pots 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 pot i …
题目链接:http://poj.org/problem?id=3414 Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18550   Accepted: 7843   Special Judge Description You are given two pots, having the volume of A and B liters respectively. The following operation…
Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7783   Accepted: 3261   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)        fi…
#include<iostream> #include<cstring> #define fillA 1 #define pourAB 2 #define dropA 3 #define fillB 4 #define pourBA 5 #define dropB 6 #define N 10000 using namespace std; ][]; class node { public: int A, B; int dir; node() { A=; B=; } }; int…
题目: http://poj.org/problem?id=3414 很好玩的一个题.关键是又16ms 1A了,没有debug的日子才是好日子.. #include <stdio.h> #include <string.h> #include <queue> #include <algorithm> #include <stack> using namespace std; int a, b, c; ][]; enum Ways{FILL_A,…
题意: 给你两个空瓶子,只有三种操作 一.把一个瓶子灌满 二.把一个瓶子清空 三.把一个瓶子里面的水灌到另一个瓶子里面去(倒满之后要是还存在水那就依然在那个瓶子里面,或者被灌的瓶子有可能没满) 思路:BFS,打印路径时需技巧. //G++ 840K 0MS #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <stack> #in…