码迷,mamicode.com
首页 >  
搜索关键字:hdu 1059    ( 30933个结果
hdu 4276(树形dp)
题意:带权树上有起点终点每个点上有宝藏,一个人只有T分钟要从起点到重点,问你最多能收集多少宝藏。思路:树形dp,首先判断能不能走到终点,然后把路径上的边权变为0时间减去所有边权。dp[v][j]表示从v出发回到v话费j分钟最多能收集到的宝藏。dp[v][j] = max(dp[v][j], dp[x...
分类:其他好文   时间:2014-05-10 01:47:33    阅读次数:324
HDU 3038 How Many Answers Are Wrong(种类并查集)
题目链接食物链类似的题,主要是在于转化,a-b的和为s,转换为b比a-1大s。然后并查集存 此节点到根的差。假如x的根为a,y的根为b:b - y = rank[y]a - x = rank[x]y - x = s可以推出b - a = rank[y] - rank[x] + s;并查集 延迟更新什...
分类:其他好文   时间:2014-05-09 18:38:05    阅读次数:213
HDU 3032 Nim or not Nim?(sg函数)
题目链接暴力出来,竟然眼花了以为sg(i) = i啊....看表要认真啊!!!#include #include #include using namespace std;#define LL __int64int dp[10001];int sg(int x){ int flag[10001...
分类:其他好文   时间:2014-05-09 18:00:34    阅读次数:274
hdu 1159
题意:求最长子序列#include#includeusing namespace std;int max(int x,int y){ if(x>y) return x; return y;}int map[1001][1001];char s1[1001],s2[1001];int main(){ ...
分类:其他好文   时间:2014-05-07 20:07:29    阅读次数:202
hdu 1176
数塔问题#include#includeusing namespace std;int a[100009][12];int maxi(int a,int b,int c){ int max1; max1=a>b?a:b; max1=max1>c?max1:c; return ...
分类:其他好文   时间:2014-05-07 19:25:00    阅读次数:302
hdu 3030 Increasing Speed Limits (离散化+树状数组+DP思想)
Increasing Speed LimitsTime Limit: 2000/10000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 481Accepted Submission(s):...
分类:其他好文   时间:2014-05-07 18:28:10    阅读次数:475
hdu 1102 Constructing Roads (最小生成树)
Constructing RoadsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12967Accepted Submission(s): 491...
分类:其他好文   时间:2014-05-07 18:04:54    阅读次数:266
hdu acm 1166 敌兵布阵 (线段树)
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 37903 Accepted Submission(s): 15985 Problem ...
分类:其他好文   时间:2014-05-07 17:52:06    阅读次数:317
hdu 1879 继续畅通工程 (最小生成树)
继续畅通工程Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12717Accepted Submission(s): 5506Problem Des...
分类:其他好文   时间:2014-05-07 10:15:02    阅读次数:318
hdu 1233 还是畅通工程 (最小生成树)
还是畅通工程Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24027Accepted Submission(s): 10674Problem De...
分类:其他好文   时间:2014-05-07 10:07:17    阅读次数:352
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!