![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Dynamic Programming
文章平均质量分 76
吴钩揽月
这个作者很懒,什么都没留下…
展开
-
无穷背包问题
#include#include#includeusing namespace std;ifstream fin("C:\\data15.in");int totalVolumn;int weight[100],volumn[100];int n;int scheme[10000];int num[100];void Init()原创 2014-11-11 10:52:26 · 657 阅读 · 0 评论 -
Coins Change
UVA 674问题描述Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.For example, if we have 1转载 2014-11-16 09:45:05 · 752 阅读 · 0 评论 -
百度的新大厦
J:百度的新大厦 时间限制: 1000ms 内存限制: 65536kB 描述 继百度搜索框大厦之后,百度又于2012年初在深圳奠基了新的百度国际大厦,作为未来百度国际化的桥头堡。不同于百度在北京的搜索框大厦,新的百度国际大厦是一栋高楼,有非常多的楼层,让每个楼中的电梯都能到达所有楼层将是一个极为不明智的设计。因此,设计师给出了一个特别的设计——一共大厦有m个电梯,每个电梯只有两个按钮,原创 2014-11-17 18:56:42 · 779 阅读 · 0 评论 -
UVA10006----CarmichaelNumbers
问题描述:An important topic nowadays in computer science is cryptography. Some people even think that cryptography is the only important field in computer science, and that life would not matter at all原创 2014-11-22 12:04:19 · 492 阅读 · 0 评论 -
UVA10673---Play With Floor And Ceil
问题描述:Problem APlay with Floor and CeilInput: standard inputOutput: standard outputTime Limit: 1 second TheoremFor any two integers x and k there exists two more integers p and q such原创 2014-11-22 13:18:42 · 497 阅读 · 0 评论 -
POJ1081--You Who?
You Who?Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 702Accepted: 249Description On the first day of first grade at Friendly Elementrary School, it is customary for each student原创 2014-11-29 12:05:00 · 853 阅读 · 0 评论 -
POJ1100---Dreisam Equations
问题描述:Dreisam EquationsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2060 Accepted: 418DescriptionDuring excavations in the Dreisamwuste, a desert on some far away and probabl原创 2014-11-26 16:23:39 · 1124 阅读 · 0 评论 -
POJ 1508-------Skyscraper Floor
问题描述:Skyscraper FloorsTime Limit: 10000MS Memory Limit: 10000KTotal Submissions: 810 Accepted: 175Description What a great idea it is to build skyscrapers! Using not too large area of la原创 2014-12-03 23:35:01 · 740 阅读 · 0 评论 -
(DAG)NestedRectangle
#include#include#includeusing namespace std;ifstream fin("C:\\data12_1.in");struct rect{rect(int a=0,int b=0):length(a),width(b){}int length;int width;};rect arr[100]转载 2014-11-10 20:41:15 · 528 阅读 · 0 评论 -
Twin Towers
Problem BThe Twin TowersInput: standard inputOutput: standard output Once upon a time, in an ancient Empire, there were two towers of dissimilar shapes in two different cities. The towers we原创 2014-11-15 18:59:24 · 671 阅读 · 0 评论 -
Cutting Sticks
You have to cut a wood stick into pieces. The most affordable company, The Analog Cutting Machinery, Inc. (ACM), charges money according to the length of the stick being cut. Their procedure of work r原创 2014-11-16 08:55:17 · 497 阅读 · 0 评论 -
Stacking Boxes
UVA 103 问题描述 Stacking Boxes BackgroundSome concepts in Mathematics and Computer Science are simple in one or two dimensions but become more complex when extended to arbi转载 2014-11-16 13:47:50 · 554 阅读 · 0 评论 -
DP入门之一 金字塔
//这个wom#include#include#includeusing namespace std;ifstream fin("C:\\data12.in");int data[32767];int prev[32676];int maxsum[32767];int n;void Init(){fin>>n;in原创 2014-11-10 10:04:17 · 529 阅读 · 0 评论 -
0_1背包问题
//此问题由于在暑假看过提示,这里算buan转载 2014-11-11 14:51:19 · 597 阅读 · 0 评论 -
硬币问题
//此版本和wode#include#include#includeusing namespace std;ifstream fin("C:\\data14.in");int S;int V[1000];int n;int total[1000];int scheme[10000];void Init(){int valu转载 2014-11-11 09:06:10 · 519 阅读 · 0 评论 -
硬币问题
#include#include#includeusing namespace std;ifstream fin("C:\\data14.in");int n,S;int V[100];int scheme[10000];int value[100];int prev[10000];int trans[10000];void So原创 2014-11-10 15:24:35 · 478 阅读 · 0 评论 -
(GAD)NestedRectangle
//同样k#include#include#includeusing namespace std;ifstream fin("C:\\data13.in");struct rect{rect(int a=0,int b=0):length(a),width(b){}int length;int width;};rect原创 2014-11-10 14:13:14 · 570 阅读 · 0 评论 -
最优三角形剖分
#include#include#include#includeusing namespace std;ifstream fin("C:\\data18.in");char ID[100];int xpos[100];int ypos[100];int n;float weight[100][100];int seperatePos[10原创 2014-11-13 11:24:45 · 630 阅读 · 0 评论 -
MATRIX_CHAIN
//这是按照算法导论给出解法写出的算法#include#include#includeusing namespace std;ifstream fin("C:\\data17.in");char ID[100];int length[100],width[100];int n;int multinum[100][100];int s[100][100];#define M翻译 2014-11-12 21:17:35 · 601 阅读 · 0 评论 -
树的最大独立集
#include#include#includeusing namespace std;ifstream fin("C:\\data19.in");struct node{ node(int n=0):data(n),c(0),gc(1),parent(NULL),left(NULL),right(NULL){} int data; int c; int gc; stru原创 2014-11-14 11:23:40 · 870 阅读 · 0 评论 -
Longest Run On A Snowboard
题目:UVA 10285 Longest Run On A SnowboardLongest Run on a SnowboardInput: standard inputOutput: standard outputTime Limit: 5 secondsMemory Limit: 32 MB Michael likes snowboarding. That's原创 2014-11-15 10:27:55 · 610 阅读 · 0 评论 -
表达式树及其变体,以及我是如何借着个原理实现简易计算器的功能的
本题来源:《算法竞赛入门》第11章11.11.2本题给的解法:核心代码:int build_tree(string exp,int l,int r){ cout<<"l="<<l<<"\tr="<<r<<endl; int c1,c2,p,u; c1=-1; c2=-1; p=0; if(r-l<=1) { u=++cnt; chl[u]=chr[u]=0;原创 2014-12-11 18:46:55 · 645 阅读 · 0 评论