ICode9

精准搜索请尝试: 精确搜索
  • POJ1606 Jugs2021-02-24 20:05:41

    解法一:\(BFS\) 每次扩展的状态有\(6\)个。宽搜多写写还是有好处的。 const int N=110; struct Node { int ca,cb; int dist; string path; }; bool vis[N][N]; string op[]={"FILL(1)","FILL(2)","DROP(1)","DROP(2)","POUR(1,2)",

  • LeetCode-365 Water and Jug Problem2019-07-25 14:50:44

    题目描述 You are given two jugs with capacities xand y litres. There is an infinite amount of water supply available. You need to determine whether it is possible to measure exactly z litres using these two jugs. If z liters of water is measurable, you

  • BFS——《算法笔记》8.2小节 问题 A: Jugs2019-04-09 13:48:52

    首先,我的代码过了样例,但OJ上并没有过(只过了50%),并且神奇的是该题提交记录里没一个人过的(不知道是不是题目的问题)    下面是我的代码,用BFS解决,找出最优路径: #include<iostream> #include<queue> #include<string> #include<string.h> using namespace std; struct node {

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

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

ICode9版权所有