摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4647树上的博弈,直接把边权平分到两边的节点上,然后排个序,从大往小取#include #include #include #include using namespace std;const int maxn = 100100;int n , m;double a[maxn];int main() { while(~scanf("%d%d",&n,&m)) { for(int i=1;i=1;i-=2) { ans += a[i] - a[i-1]; ... 阅读全文
posted @ 2013-08-08 19:34
tobec
阅读(180)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4665搜索;搜索前的剪枝:对于某个数num,第一次出现的num标记为0,最后一个出现的num标记为1;搜索中的剪枝:如果不能匹配,一定是错的#include #include #include #include using namespace std;const int maxn = 2002;int a[maxn] , t[maxn] , id[maxn] , n , T , pos[maxn][5];int idd[maxn];int f[maxn] , g[maxn] , cf , cg;void in 阅读全文
posted @ 2013-08-08 19:24
tobec
阅读(612)
评论(0)
推荐(0)


浙公网安备 33010602011771号