-
大小: 8KB文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2021-01-11
- 語言: 其他
- 標簽: 動態(tài)規(guī)劃??程序??體現(xiàn)思想??
資源簡介
算法設(shè)計與分析 動態(tài)規(guī)劃 程序 體現(xiàn)思想
代碼片段和文件信息
#include?
#include?
#include?
#define?MAX_N?1000
#define?INFINITE?1000000
int?t?n?x?y?max;
struct?Platform
{
????int?Lx?Rx?h;
}?;
Platform?aPlatform[MAX_N?+?10];
int?aLeftMinTime[MAX_N?+?10];
int?aRightMinTime[MAX_N?+?10];
int?MyCompare(?const?void?*?e1?const?void?*?e2?)
{
????Platform?*?p1?*?p2;
????p1?=?(Platform?*?)?e1;
????p2?=?(Platform?*?)?e2;
????return?p2->h?-?p1->h;?//從大到小排列
}
int?MinTime(?int?L?bool?bLeft?)
{
????int?y?=?aPlatform[L].h;
????int?i?x;
????if(?bLeft?)
????????x?=?aPlatform[L].Lx;
????else
????????x?=?aPlatform[L].Rx;
????for(?i?=?L?+?1;i?<=?n;i?++?)?//找到下一張板子
????{
????????if(?aPlatform[i].Lx?<=?x?&&?aPlatform[i].Rx?>=?x)
????????????break;
????}
????if(?i?<=?n?)?//找到了
????{
????????if(?y?-?aP
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2132??2013-12-08?01:02??dynamic?programming\Cpp1.cpp
?????文件???????3377??2013-12-08?01:02??dynamic?programming\Cpp1.dsp
?????文件????????516??2013-12-08?01:02??dynamic?programming\Cpp1.dsw
?????文件??????41984??2014-04-17?17:26??dynamic?programming\Cpp1.ncb
?????文件??????48640??2014-04-17?17:26??dynamic?programming\Cpp1.opt
?????文件????????728??2014-04-17?17:26??dynamic?programming\Cpp1.plg
?????目錄??????????0??2014-04-18?15:54??dynamic?programming
-----------?---------??----------?-----??----
????????????????97377????????????????????7
評論
共有 條評論