ICode9

精准搜索请尝试: 精确搜索
  • H - Pots2021-07-31 09:00:06

    H - Pot s传送门 题目大意 输入两个容器的容量A,B,一开始让两个容器为空,然后给你对这两个容器的6种操作, 让你用这6种操作最终使得A或B容器里的水最终达到C,让你输出需要倒水的次数,以及从一开始到后来得到结果的路径。(要求C的大小在A和B之间) 思路 每次可以执行六种操作{"FILL(1)","FI

  • POJ-3414 Pots(倒水问题-bfs手写队列)2021-06-05 19:08:21

    Pots Time Limit: 1000MS Memory Limit: 65536K 题目链接http://poj.org/problem?id=3414 Description You are given two pots, having the volume of A and B liters respectively. The following operations can be performed: 1.FILL(i) fill the pot i (1 ≤ i ≤ 2) from

  • poj3414 Pots2021-01-23 09:36:42

    搜索空间不过 \(1e4\) ,暴力 \(bfs\) 即可得到最少操作。 输出每次操作可能需要手动模拟栈,方便找到最优解后回溯输出。 /** * poj3414 Pots * */ #include <cstdio> #include <queue> #include <iostream> #include <cstring> #include <stack> using namespace std; const int N

  • Pots POJ - 3414(DFS)2020-08-07 10:01:48

    Pots 小明给你两个容器,分别能装下A升水和B升水,并且可以进行以下操作 FILL(i)        将第i个容器从水龙头里装满(1 ≤ i ≤ 2); DROP(i)        将第i个容器抽干 POUR(i,j)      将第i个容器里的水倒入第j个容器(这次操作结束后产生两种结果,一是第j个容器倒满并且第i个

  • POJ 3414 Pots(bfs)2019-08-08 10:05:54

    - POJ 3414 - Pots Time Limit: 1000MS | Memory Limit: 65536K Special Judge 题意: 给定两个容量分别为 A升 和 B 升的罐子。可以执行以下操作: 1、FILL(i) —— 从水龙头引水把 i 罐注满(1≤i≤2); 2、DROP(i) —— 倒空 i 罐到排水管; 3、POUR(i,j) —— 把 i 罐的水倒入 j

  • 【POJ】3414 Pots (BFS)2019-07-31 22:00:58

    题目连接 大致题意 告诉你两个壶的体积分别为A,B,开始两个壶都是空的,然后你可以把一个壶倒满,或者倒空,或者把一个壶里的水到给另一个壶直到另一个壶被倒满或者这个壶被倒空。 问你通过一系列的操作后是否可以使得其中一个壶里水的量为C,如果可以则输出最少操作次数,并输出相应的步骤

  • OpenJ_Bailian - 3151 : Pots2019-05-07 21:55:31

    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)   

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有