![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Dynamic Programming
Goahead123321
这个作者很懒,什么都没留下…
展开
-
子数组之和的最大值
编程之美/* 编程之美 2.14 求数组的子数组之和的最大值 Dynamic Programming*/#include using namespace std;int MaxSum(int *arr, int n);int main(){ int arr[] = {1, -2, 3, 5, -3, 2}; int arr1[] = {0, -2, 3, 5, -1,原创 2013-05-17 09:04:57 · 605 阅读 · 0 评论 -
丑数
Version 1/* 丑数*/#include using namespace std;int divide(int n, int m);int isUgly(int n);int main(){ int n = 1; int account = 0; int num = 100; while (1) { if (isUgly(n)) {原创 2013-05-17 10:11:27 · 437 阅读 · 0 评论 -
斐波纳契数列
Fibonacci三种不同的方法/* Fibonacci Version 1: Recursion Version 2: Dynamic Programming (Top-Down Memoization) Version 3: Dynamic Programming (Bottom-Up tabulation)*/#include using namespace std;原创 2013-05-17 09:46:06 · 575 阅读 · 0 评论 -
Ugly Numbers
Dynamic Programming#include using namespace std;unsigned int min(unsigned int a, unsigned int b, unsigned int c){ if(a <= b) { if(a <= c) { return a; } else { retur原创 2013-09-20 23:46:35 · 648 阅读 · 0 评论