摘要: Description: 在方格图上找一条回路使经过的权值最小 Hint: $n using namespace std; typedef long long ll; const int mxn=102,c[4]={0, 1,1,0}; struct data { int key; ll val; 阅读全文
posted @ 2019-02-24 15:59 cloud_9 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Description: 给定一棵n个点的树,点带点权。 有m次操作,每次操作给定x,y,表示修改点x的权值为y。 你需要在每次操作之后求出这棵树的最大权独立集的权值大小。 Hint: $n,m define ls psz[son[u]]) son[u]=v; } } void dfs2(int u 阅读全文
posted @ 2019-02-24 13:52 cloud_9 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Description: 给定一棵n个点的带权树,结点下标从1开始到N。寻找树中找两个结点,求最长的异或路径。 Hint: $n using namespace std; const int mxn=1e7+5; struct ed { int to,nxt,w; }t[mxn=0; i) { in 阅读全文
posted @ 2019-02-24 13:45 cloud_9 阅读(193) 评论(0) 推荐(0) 编辑