YY_More

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年7月6日

摘要: 我才发现我这么水。原打算随便再找道题早上热身,结果WA一直到现在。改了一天,结果发现是最白痴的错误。这道题本质上还是树形的背包,但是枚举的时候要多考虑以某儿子为根的树被整个砍掉的情况。//By YY_More#include<cstdio>#include<iostream>using namespace std;struct edge{ int point; edge *next;};edge *g[151];int N,P,x,y,root,F[151][151],goin[151];int INF=200;void insert(int father,int so 阅读全文
posted @ 2011-07-06 16:47 YY_More 阅读(200) 评论(0) 推荐(0) 编辑

摘要: 这也是道树形的背包,很恶心。以至于我都不想解释了。。。都在程序里。//By YY_More#include<cstdio>#include<cstring>struct edge{ int point; edge *next;};int N,K,a,b,W[201],F[101][201],H[101][201];bool ed[101];edge *g[101];void insert(int from,int to){ edge *p=new edge; (*p).next=g[from]; g[from]=p; (*p).point=to;} void dp(in 阅读全文
posted @ 2011-07-06 00:21 YY_More 阅读(338) 评论(0) 推荐(0) 编辑