快速切题 poj3414 Pots】的更多相关文章

Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10042   Accepted: 4221   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…
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…
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: 12198   Accepted: 5147   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…
题目链接: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…
题意:通过题目给出的三种操作,让任意一个杯子中的水到达一定量 分析:两个杯子最大容量是100,所以开个100*100的数组记录状态,最多1w个状态,所以复杂度很低,然后记录一下路径就好 注:代码写残了,我也不会写好看的那种,罪过罪过..QAQ #include<cstdio> #include<algorithm> #include<iostream> #include<cstring> #include<cmath> #include<m…
这道题做了很长时间,一开始上课的时候手写代码,所以想到了很多细节,但是创客手打代码的时候由于疏忽又未将pair赋初值,导致一直输出错误,以后自己写代码可以专心一点,可能会在宿舍图书馆或者Myhome,创客晚上好吵呀,隔壁真的服... 本题大意:给定两个杯子的容量,有六种操作,通过操作使得两个被子其中一个杯子的水等于待输入值C,并输出最少操作次数和操作名称. 本题思路:BFS,遇到合适的直接输出,搜完都没有搜到就impossible. 参考代码: 将switch改为if能节省大部分篇幅,但是swi…
127. Telephone directory time limit per test: 0.25 sec. memory limit per test: 4096 KB CIA has decided to create a special telephone directory for its agents. The first 2 pages of the directory contain the name of the directory and instructions for a…
126. Boxes time limit per test: 0.25 sec. memory limit per test: 4096 KB There are two boxes. There are A balls in the first box, and B balls in the second box (0 < A + B < 2147483648). It is possible to move balls from one box to another. From one…
123. The sum time limit per test: 0.25 sec. memory limit per test: 4096 KB The Fibonacci sequence of numbers is known: F1 = 1; F2 = 1; Fn+1 = Fn + Fn-1, for n>1. You have to find S - the sum of the first K Fibonacci numbers. Input First line contains…