算法_动态规划
文章平均质量分 67
NJUTONY
吉林大学09级软件学院南京大学计算机研究生在读
展开
-
tyvj1005(0——1背包问题)
联系帮助Tyvj Information ---- Total Users : 9639 | Online Users / Processes : 212 / 235 | Processed Time : 8 ms | Server Time : 2010-10-2 20:38:34 //采草药,第一次试着自己写背包问题,纪念一下#include#includeusing namespace std;int num[105];//每株草药的价值int time[105];//采原创 2010-10-02 20:50:00 · 610 阅读 · 0 评论 -
TopCoder-AvoidRoads
题目地址:http://community.topcoder.com/stat?c=problem_statement&pm=1889&rd=4709原创 2014-08-27 22:04:14 · 569 阅读 · 0 评论 -
TopCoder-ChessMetric
题目地址:http://community.topcoder.com/stat?c=problem_statement&pm=1592&rd=4482原创 2014-08-28 10:55:20 · 767 阅读 · 0 评论 -
TopCoder-BadNeighbours
题目描述:http://community.topcoder.com/stat?c=problem_statement&pm=2402&rd=5009原创 2014-08-27 21:42:09 · 781 阅读 · 0 评论 -
TopCoder—ZigZag
Problem Statement A sequence of numbers is called a zig-zag sequence if the differencesbetween successive numbers strictly alternate between positive and negative. Thefirst difference (if原创 2014-08-27 21:25:39 · 759 阅读 · 0 评论 -
Uva10635 Prince and Princess(LIS)
题目地址:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1576题目大意:原创 2014-04-12 14:01:32 · 556 阅读 · 0 评论 -
装配站问题(动态规划)
<br />#include<stdio.h>using namespace std;int t[3][10];int f[3][10];int a[3][10];int l[3][10];int e1,e2,x1,x2;int n,s,l1;void Print(){ int k=l1; printf("line %d,station %d/n",k,n); for(int i=n;i>=2;i--) { k=l原创 2011-04-24 08:48:00 · 688 阅读 · 0 评论 -
tyvj1055(石子合并)动规基础
FromAdmin☆沙子合并 描述 Description 设有N堆沙子排成一排,其编号为1,2,3,…,N(N<=300)。每堆沙子有一定的数量,可以用一个整数来描述,现在要将这N堆沙子合并成为一堆,每次只能合并相邻的两堆,合并的代价为这两堆沙子的数量之和,合并后与这两堆沙子相邻的沙子将和新堆相邻,合并时由于选择的顺序不同,合并的总代价也不相同,如有4堆沙子分别为 1 3 5 2 我们可以先合并1、2堆,代价为4,得到4 5 2 又合并 1,2堆,代价为9,得到9 2原创 2011-04-12 12:43:00 · 882 阅读 · 0 评论 -
Tyvj1044数字三角形(动态规划入门)
FromAdmin☆数字三角形 背景 Background 09年 USACO 11月月赛 铜牌第一道 描述 Description 示出了一个数字三角形。 请编一个程序计算从顶至底的某处的一条路<br />径,使该路径所经过的数字的总和最大。<br /> 每一步可沿左斜线向下或右斜线向下走;<br /> 1<三角形行数<25;<br /> 三角形中的数字为整数<1000;<br /><br /> 输入格式 Input Format 第一行为N,原创 2011-03-27 17:58:00 · 792 阅读 · 0 评论 -
hdoj1231(最大连续子序列)
<br />题目源:http://acm.hdu.edu.cn/showproblem.php?pid=1231<br />简单的最大子段和问题,只是加上了求子段的起点和终点<br /> <br /> <br />#include<stdio.h><br />int num[10005];<br />int main()<br />{<br /> int n;<br /> while(scanf("%d",&n))<br /> {<br /> if(原创 2011-02-17 23:59:00 · 582 阅读 · 1 评论 -
LeetCode Maximum Product SubArray
题目描述:https://oj.leetcode.com/problems/maximum-product-subarray/原创 2014-10-26 21:08:39 · 578 阅读 · 0 评论