andre_joy

导航

2012年8月9日

hdu 4340

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=4340题意:两个人抢劫一个城市,每个人抢前一个城市相邻的城市的时候只用花费1/2的时间,求最短时间。mark:树状dp。dp[i][j][k]代表第i个城市由第j个人抢劫,第i个城市所属子树需要完全时间的个数。代码:#include <stdio.h>#include <string.h>#include <stdlib.h>const int M = 105;const int N = 10000000;int n,s[2][M];int dp[M][2][2];b 阅读全文

posted @ 2012-08-09 18:44 andre_joy 阅读(229) 评论(0) 推荐(0) 编辑