HDU
迷麟Milin
There isn't time, so brief is life, for bickerings, apologies, heartburnings, callings to account. There is only time for loving, and but an instant, so to speak, for that. The good life is built with good relationships.
——Mark Twain
展开
-
畅通工程 HDU1232
Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 10...原创 2018-08-27 15:52:51 · 317 阅读 · 0 评论 -
hdu 1087 Super Jumping! Jumping! Jumping!(动态规划DP)
题目描述 给定长度为n的正整数序列a1,a2,…,an。 求一个递增的子序列,和最大。 思路: 动态规划 对于任意的 j < i => dp[i] = max(dp[i], dp[j] + a[i]) C++代码如下: // 给定长度为n的正整数序列a1,a2,…,an。 // 求一个递增的子序列,和最大。 // 对于任意的 j < i =&g...原创 2019-06-20 20:14:29 · 130 阅读 · 0 评论