<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5834787003042487507</id><updated>2011-04-22T07:29:34.733+08:00</updated><category term='dp'/><category term='lcs'/><category term='huffman'/><category term='背包'/><category term='dfs'/><title type='text'>D.B.'s Solutions for Some Easy Problems</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dbwxh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dbwxh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>D.B.</name><uri>http://www.blogger.com/profile/15937183288513864370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_K5FWqVyxg7s/SfgJ7b6hdOI/AAAAAAAAAEE/UO1ffa1eaTw/S220/Jane.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5834787003042487507.post-7353567333914203427</id><published>2009-05-14T10:28:00.000+08:00</published><updated>2009-05-14T10:29:40.867+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lcs'/><category scheme='http://www.blogger.com/atom/ns#' term='dp'/><title type='text'>Zju/Zoj 3034 The Bridges of Kolsberg</title><content type='html'>&lt;table class="list"&gt;&lt;tbody&gt;&lt;tr class="rowOdd"&gt;&lt;td class="runSubmitTime"&gt;2009-05-14 10:27:49&lt;/td&gt;                         &lt;td class="runJudgeStatus"&gt;                             &lt;span class="judgeReplyAC"&gt;                                                                      Accepted                                                              &lt;/span&gt;&lt;/td&gt;                         &lt;td class="runProblemId"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=2032"&gt;3034&lt;/a&gt;&lt;/td&gt;                         &lt;td class="runLanguage"&gt;C++&lt;/td&gt;                         &lt;td class="runTime"&gt;520&lt;/td&gt;                         &lt;td class="runMemory"&gt;15988&lt;/td&gt;                         &lt;td class="runUserName"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showUserStatus.do?userId=27691"&gt;&lt;span style="color:#db6d00;"&gt;80%完美的日子&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;LCS模型的DP。f[i][j]记录匹配度，g[i][j]记录匹配数。&lt;br /&gt;状态转移方程f[i][j]=MAX{f[i-1][j-1]+v[i]+v[j]，f[i][j-1]，f[i-1][j]}。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5834787003042487507-7353567333914203427?l=dbwxh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbwxh.blogspot.com/feeds/7353567333914203427/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5834787003042487507&amp;postID=7353567333914203427' title='1 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/7353567333914203427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/7353567333914203427'/><link rel='alternate' type='text/html' href='http://dbwxh.blogspot.com/2009/05/zjuzoj-3034-bridges-of-kolsberg.html' title='Zju/Zoj 3034 The Bridges of Kolsberg'/><author><name>D.B.</name><uri>http://www.blogger.com/profile/15937183288513864370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_K5FWqVyxg7s/SfgJ7b6hdOI/AAAAAAAAAEE/UO1ffa1eaTw/S220/Jane.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834787003042487507.post-5574361549610099441</id><published>2009-05-11T19:38:00.004+08:00</published><updated>2009-05-11T20:01:42.545+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='huffman'/><title type='text'>Zju/Zoj 1117 Entropy</title><content type='html'>&lt;table class="list"&gt;&lt;tbody&gt;&lt;tr class="rowOdd"&gt;&lt;td class="runSubmitTime"&gt;2009-05-11 19:35:10&lt;/td&gt;                         &lt;td class="runJudgeStatus"&gt;                             &lt;span class="judgeReplyAC"&gt;                                                                      Accepted                                                              &lt;/span&gt;&lt;/td&gt;                         &lt;td class="runProblemId"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=117"&gt;1117&lt;/a&gt;&lt;/td&gt;                         &lt;td class="runLanguage"&gt;C++&lt;/td&gt;                         &lt;td class="runTime"&gt;0&lt;/td&gt;                         &lt;td class="runMemory"&gt;212&lt;/td&gt;                         &lt;td class="runUserName"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showUserStatus.do?userId=27691"&gt;&lt;span style="color: rgb(219, 109, 0);"&gt;80%完美的日子&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;直接哈夫曼树应硬搞即可。哈夫曼树用优先队列比较方便。&lt;br /&gt;建二叉树的时候预先暴力开个数组，结点指针就可以int，&lt;br /&gt;避免了讨厌的指针。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5834787003042487507-5574361549610099441?l=dbwxh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbwxh.blogspot.com/feeds/5574361549610099441/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5834787003042487507&amp;postID=5574361549610099441' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/5574361549610099441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/5574361549610099441'/><link rel='alternate' type='text/html' href='http://dbwxh.blogspot.com/2009/05/zjuzoj-1117-entropy.html' title='Zju/Zoj 1117 Entropy'/><author><name>D.B.</name><uri>http://www.blogger.com/profile/15937183288513864370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_K5FWqVyxg7s/SfgJ7b6hdOI/AAAAAAAAAEE/UO1ffa1eaTw/S220/Jane.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834787003042487507.post-4961625054655360723</id><published>2009-05-09T09:15:00.003+08:00</published><updated>2009-05-09T09:22:44.302+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dfs'/><category scheme='http://www.blogger.com/atom/ns#' term='dp'/><title type='text'>Zju/Zoj 2922 Bombs</title><content type='html'>&lt;table class="list"&gt;&lt;tbody&gt;&lt;tr class="rowOdd"&gt;&lt;td class="runSubmitTime"&gt;2009-05-09 09:14:24&lt;/td&gt;                         &lt;td class="runJudgeStatus"&gt;                             &lt;span class="judgeReplyAC"&gt;                                                                      Accepted                                                              &lt;/span&gt;&lt;/td&gt;                         &lt;td class="runProblemId"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1921"&gt;2922&lt;/a&gt;&lt;/td&gt;                         &lt;td class="runLanguage"&gt;C++&lt;/td&gt;                         &lt;td class="runTime"&gt;440&lt;/td&gt;                         &lt;td class="runMemory"&gt;15888&lt;/td&gt;                         &lt;td class="runUserName"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showUserStatus.do?userId=27691"&gt;&lt;span style="color:#db6d00;"&gt;80%完美的日子&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;从每个bomb出发dfs，标记被覆盖的bomb，dfs的时候采取记忆化。&lt;br /&gt;最后扫一遍累加未被标记（为被覆盖）的bomb即可。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5834787003042487507-4961625054655360723?l=dbwxh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbwxh.blogspot.com/feeds/4961625054655360723/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5834787003042487507&amp;postID=4961625054655360723' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/4961625054655360723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/4961625054655360723'/><link rel='alternate' type='text/html' href='http://dbwxh.blogspot.com/2009/05/zjuzoj-2922-bombs.html' title='Zju/Zoj 2922 Bombs'/><author><name>D.B.</name><uri>http://www.blogger.com/profile/15937183288513864370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_K5FWqVyxg7s/SfgJ7b6hdOI/AAAAAAAAAEE/UO1ffa1eaTw/S220/Jane.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834787003042487507.post-3982274960101104254</id><published>2009-05-08T19:44:00.003+08:00</published><updated>2009-05-08T19:50:58.111+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dfs'/><title type='text'>Zju/Zoj 2734 Exchange Cards</title><content type='html'>&lt;table class="list"&gt;&lt;tbody&gt;&lt;tr class="rowOdd"&gt;&lt;td class="runSubmitTime"&gt;2009-05-08 19:40:36&lt;/td&gt;                         &lt;td class="runJudgeStatus"&gt;                             &lt;span class="judgeReplyAC"&gt;                                                                      Accepted                                                              &lt;/span&gt;&lt;/td&gt;                         &lt;td class="runProblemId"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1734"&gt;2734&lt;/a&gt;&lt;/td&gt;                         &lt;td class="runLanguage"&gt;C++&lt;/td&gt;                         &lt;td class="runTime"&gt;0&lt;/td&gt;                         &lt;td class="runMemory"&gt;184&lt;/td&gt;                         &lt;td class="runUserName"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showUserStatus.do?userId=27691"&gt;&lt;span style="color: rgb(219, 109, 0);"&gt;80%完美的日子&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;别人随便乱切的dfs，我差点开hash判重。&lt;br /&gt;一点总结，暴搜的时候，先仔细分析解空间，多传几个参数或许会更方便。&lt;br /&gt;另外又PE一次，也不太尴尬了。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5834787003042487507-3982274960101104254?l=dbwxh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbwxh.blogspot.com/feeds/3982274960101104254/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5834787003042487507&amp;postID=3982274960101104254' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/3982274960101104254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/3982274960101104254'/><link rel='alternate' type='text/html' href='http://dbwxh.blogspot.com/2009/05/zjuzoj-2734-exchange-cards.html' title='Zju/Zoj 2734 Exchange Cards'/><author><name>D.B.</name><uri>http://www.blogger.com/profile/15937183288513864370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_K5FWqVyxg7s/SfgJ7b6hdOI/AAAAAAAAAEE/UO1ffa1eaTw/S220/Jane.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834787003042487507.post-5547285492112540492</id><published>2009-05-08T15:42:00.004+08:00</published><updated>2009-05-08T17:21:19.620+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dp'/><title type='text'>Zju/Zoj 1883 Tight Words</title><content type='html'>&lt;table class="list"&gt;&lt;tbody&gt;&lt;tr class="rowOdd"&gt;&lt;td class="runId"&gt;&lt;br /&gt;&lt;/td&gt;                         &lt;td class="runSubmitTime"&gt;2009-05-08 15:35:25&lt;/td&gt;                         &lt;td class="runJudgeStatus"&gt;                             &lt;span class="judgeReplyAC"&gt;                                                                      Accepted                                                              &lt;/span&gt;&lt;/td&gt;                         &lt;td class="runProblemId"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=883"&gt;1883&lt;/a&gt;&lt;/td&gt;                         &lt;td class="runLanguage"&gt;C++&lt;/td&gt;                         &lt;td class="runTime"&gt;0&lt;/td&gt;                         &lt;td class="runMemory"&gt;192&lt;/td&gt;                         &lt;td class="runUserName"&gt;&lt;a href="http://acm.zju.edu.cn/onlinejudge/showUserStatus.do?userId=27691"&gt;&lt;span style="color: rgb(219, 109, 0);"&gt;80%完美的日子&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;这题我没有压缩状态直接硬搞，每个状态记录 词的第i位的数字（0～9）个数，&lt;br /&gt;typedef struct&lt;br /&gt;{&lt;br /&gt;  double count[10];&lt;br /&gt;}Status;&lt;br /&gt;Status f[105];//f[i]表示第i位的状态&lt;br /&gt;累加f[n].count[j]，j从0扫到k，即可。&lt;br /&gt;(k+1)^n好像会超精度，其实不用怕，因为只保留小数点后5位，0.00000即可。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5834787003042487507-5547285492112540492?l=dbwxh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbwxh.blogspot.com/feeds/5547285492112540492/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5834787003042487507&amp;postID=5547285492112540492' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/5547285492112540492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/5547285492112540492'/><link rel='alternate' type='text/html' href='http://dbwxh.blogspot.com/2009/05/zjuzoj-1883-tight-words.html' title='Zju/Zoj 1883 Tight Words'/><author><name>D.B.</name><uri>http://www.blogger.com/profile/15937183288513864370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_K5FWqVyxg7s/SfgJ7b6hdOI/AAAAAAAAAEE/UO1ffa1eaTw/S220/Jane.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834787003042487507.post-3193472989255004407</id><published>2009-04-29T15:13:00.002+08:00</published><updated>2009-04-29T15:49:11.899+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dp'/><title type='text'>Hdu/Hdoj 2048 数塔</title><content type='html'>&lt;table style="border-bottom: 1px dashed rgb(135, 155, 255);" class="table_text" width="100%" align="center" border="0" cellspacing="2"&gt;&lt;tbody&gt;&lt;tr align="center" bgcolor="#d7ebff"&gt;&lt;td&gt;2009-04-29 15:48:24&lt;/td&gt;&lt;td&gt;&lt;span style="color:red;"&gt;Accepted&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;a href="http://acm.hdu.edu.cn/showproblem.php?pid=2084"&gt;2084&lt;/a&gt;&lt;/td&gt;&lt;td&gt;15MS&lt;/td&gt;&lt;td&gt;300K&lt;/td&gt;&lt;td&gt;&lt;a href="http://acm.hdu.edu.cn/viewcode.php?rid=1320040" target="_blank"&gt;440 B&lt;/a&gt;&lt;/td&gt;&lt;td&gt;C++&lt;/td&gt;&lt;td class="fixedsize"&gt;&lt;a href="http://acm.hdu.edu.cn/userstatus.php?user=wuxinghe"&gt;Master Jedi&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;对于问题“从第i层第j个结点出发 如何向下走到底层 使所经过的权值最大”，有2个选择：走左边 和 走右边。&lt;br /&gt;做出1个选择：假设选择走左边结点k，然后再按一定路线（不必考虑具体路线，假设已知）走到底层，可以得到最优解。&lt;br /&gt;那么随之发生的子问题是：“从左结点k出发 如何向下走到底层 使所经过的权值最大”。&lt;br /&gt;用反证法容易证明：从第i层第j个结点出发 向下走到底层的最优路线，包含了从左结点k出发向下走到底层的最优路线。该问题具有最优子结构性质。&lt;br /&gt;而子问题“从第i层第j个结点出发 如何向下走到底层 使所经过的权值最大”很明显具有重叠性。&lt;br /&gt;于是自底向上DP即可解决问题。&lt;br /&gt;f[i][j]：表示从第i层第j个结点出发向下走到底层能够得到的最大权值。&lt;br /&gt;状态转移方程：f[i][j]=MAX(f[i+1][j],f[i+1][j+1]);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5834787003042487507-3193472989255004407?l=dbwxh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbwxh.blogspot.com/feeds/3193472989255004407/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5834787003042487507&amp;postID=3193472989255004407' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/3193472989255004407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/3193472989255004407'/><link rel='alternate' type='text/html' href='http://dbwxh.blogspot.com/2009/04/hduhdoj-2048.html' title='Hdu/Hdoj 2048 数塔'/><author><name>D.B.</name><uri>http://www.blogger.com/profile/15937183288513864370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_K5FWqVyxg7s/SfgJ7b6hdOI/AAAAAAAAAEE/UO1ffa1eaTw/S220/Jane.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5834787003042487507.post-1706429614850212306</id><published>2009-04-28T13:56:00.005+08:00</published><updated>2009-04-29T14:42:16.974+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='背包'/><category scheme='http://www.blogger.com/atom/ns#' term='dp'/><title type='text'>Hdu/Hdoj 2670 Girl Love Value</title><content type='html'>&lt;table style="border-bottom: 1px dashed rgb(135, 155, 255);" class="table_text" width="100%" align="center" border="0" cellspacing="2"&gt;&lt;tbody&gt;&lt;tr align="center" bgcolor="#d7ebff"&gt;&lt;td&gt;2009-04-27 13:44:16&lt;/td&gt;&lt;td&gt;&lt;span style="color:red;"&gt;Accepted&lt;/span&gt;&lt;/td&gt;&lt;td&gt;&lt;a href="http://acm.hdu.edu.cn/showproblem.php?pid=2670"&gt;2670&lt;/a&gt;&lt;/td&gt;&lt;td&gt;125MS&lt;/td&gt;&lt;td&gt;4204K&lt;/td&gt;&lt;td&gt;&lt;a href="http://acm.hdu.edu.cn/viewcode.php?rid=1313193" target="_blank"&gt;870 B&lt;/a&gt;&lt;/td&gt;&lt;td&gt;C++&lt;/td&gt;&lt;td class="fixedsize"&gt;&lt;a href="http://acm.hdu.edu.cn/userstatus.php?user=wuxinghe"&gt;Master Jedi&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;把问题分为两个子问题：&lt;br /&gt;1.选出哪k个boy；&lt;br /&gt;2.按什么顺序选。&lt;br /&gt;每个boy有两个属性：喜欢度 和 衰减速度。&lt;br /&gt;其中衰减速度是关键。&lt;br /&gt;我的感觉是：最好先选择衰减速度快的人（貌似贪心），好让总的衰减值最小。&lt;br /&gt;因此先按衰减速度递减排序（解决子问题2），再DP（解决子问题1）。&lt;br /&gt;其中f[i][j]表示：从前i个人中 按一定次序选出j个人 得到的最优喜欢度。&lt;br /&gt;&lt;iostream&gt;&lt;algorithm&gt;&lt;j)&gt;&lt;f[n][k]&gt;&lt;endl;&gt;&lt;/endl;&gt;&lt;/f[n][k]&gt;&lt;/j)&gt;&lt;/algorithm&gt;&lt;/iostream&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5834787003042487507-1706429614850212306?l=dbwxh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dbwxh.blogspot.com/feeds/1706429614850212306/comments/default' title='帖子评论'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5834787003042487507&amp;postID=1706429614850212306' title='0 条评论'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/1706429614850212306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5834787003042487507/posts/default/1706429614850212306'/><link rel='alternate' type='text/html' href='http://dbwxh.blogspot.com/2009/04/hduhdoj-2670-girl-love-value.html' title='Hdu/Hdoj 2670 Girl Love Value'/><author><name>D.B.</name><uri>http://www.blogger.com/profile/15937183288513864370</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://1.bp.blogspot.com/_K5FWqVyxg7s/SfgJ7b6hdOI/AAAAAAAAAEE/UO1ffa1eaTw/S220/Jane.JPG'/></author><thr:total>0</thr:total></entry></feed>
