登录
首页 » 算法 » 找钱张数最少

找钱张数最少

于 2022-03-06 发布 文件大小:1.92 kB
0 76
下载积分: 2 下载次数: 1

代码说明:

二、问题       现只有面额为 11元、5元、1元的三种人民币。       给定一个 数目为 money 的人民币,如何用这三种面额的人民币 找开它,且用的人民币张数最少       如:给定 10元,我们可以有以下找法:             2张  5元面额             1张  5元面额  + 5 张  1元面额             10张 1元面额       我们 选择第一种找法。只用两张人民币。 三、分析  利用动态规划法可以找到最优解。         利用贪心算法可以找到最优解(问题满足贪心选择性质时。该找钱问题在 11、5、1三种面额的情况下不满足该性质)               或者找到近似 最优解(在本题设定的三种面额的情况下 便是如此)         如果现在要找开 15元钱,则      

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 一款电场线的教学软件可以自定义电荷多少,大小,位置等
    一款电场线的教学软件可以自定义电荷多少,大小,位置等-new electric line of educational software can define the number of charge, size, location, etc.
    2022-02-10 00:04:48下载
    积分:1
  • cop-kmeans 有约束的k均值聚类
    K-means算法和改进的K-means算法,它是基于成对约束COP-k均值算法。该算法结合了不容错过的链接,可以在这两种类型的约束“监管”的数据对象不-Link的限制进行划分。
    2022-09-28 18:05:02下载
    积分:1
  • 数据结构 数学计 数 据结构 数学计 数据结构 数学计...
    数据结构 数学计算 数 据结构 数学计算 数据结构 数学计算 -data structure calculation data structure calculation data structure mathematical calculations
    2022-07-06 16:24:27下载
    积分:1
  • 约瑟夫猴子游戏
    约瑟夫问题是个有名的问题:N个人围成一圈,从第一个开始报数,第M个将被杀掉,最后剩下一个,其余人都将被杀掉。例如N=6,M=5,被杀掉的顺序是:5,4,6,2,3,1。
    2022-07-09 10:25:35下载
    积分:1
  • that the procedure was constructed using wavelet neural network function of the...
    该程序是用小波函数构建神经网络的源程序。用以分析心电信号、脑电信号等等。-that the procedure was constructed using wavelet neural network function of the source. For the analysis of ECG, EEG, and so on.
    2022-02-04 20:30:21下载
    积分:1
  • 获得目录下所有文件列表并批处理
    基于MFC的文件批处理程序,从MFC打开文件对话框或者选择文件夹对话框中获得目录,再从当前目录往下得到所有文件列表,并进行批处理。
    2023-06-11 20:45:03下载
    积分:1
  • CSharp版普通
    csharp版常见数值计算源码,包括矩阵计算、插值、线性方程和非线性方程等-CSharp version of common-source numerical computation, including the matrix calculation, interpolation, linear equations and nonlinear equations, such as
    2023-03-07 05:45:03下载
    积分:1
  • 有很多的,让您来处理信息存储…
    There are numerous algorithms that allow you to manipulate the information stored in an array. Consider this function which allows you to determine the maximum value in an array of integers (could be easily adapted to find minimum value)-There are numerous algorithms that allow you to manipulate the information stored in an array. Consider this function which allows you to determine the maximum value in an array of integers (could be easily adapted to find minimum value)
    2022-03-03 22:58:15下载
    积分:1
  • 研究生期间上《数值计》课的作业,所有代码都是C语言实现并调试通过,现在上传为大家服务。这是松弛...
    研究生期间上《数值计算方法》课的作业,所有代码都是C语言实现并调试通过,现在上传为大家服务。这是松弛算法-"numerical methods" courses of operations, are all code and the C language debugging passed, and upload to us. This is the relaxation algorithm
    2022-02-01 14:42:50下载
    积分:1
  • 顺序队列C实现
    #include "stdio.h"    #include "stdlib.h"   #include "io.h"  #include "math.h"  #include "time.h"#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define MAXSIZE 20 /* 存储空间初始分配量 */typedef int Status; typedef int QElemType; /* QElemType类型根据实际情况而定,这里假设为int *//* 循环队列的顺序存储结构 */typedef struct{ QElemType data[MAXSIZE]; int front;     /* 头指针 */ int rear;  /* 尾指针,若队列不空,指向队列尾元素的下一个位置 */}SqQueue;Status visit(QElemType c){ printf("%d ",c); return OK;}/* 初始化一个空队列Q */Status Init
    2022-08-13 11:29:01下载
    积分:1
  • 696518资源总数
  • 104444会员总数
  • 15今日下载