摘要: sort一下就是cows。。。 #include<iostream> #include<cstdio> #include<cstdlib> #include<algorithm> #include<cstring> #include<cmath> #include<vector> #include< 阅读全文
posted @ 2017-10-31 16:36 探险家Mr.H 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 给定n个集合 输出每个集合是多少集合的子集 #include<iostream> #include<cstdio> #include<cstdlib> #include<algorithm> #include<cstring> #include<cmath> #include<vector> #in 阅读全文
posted @ 2017-10-31 16:35 探险家Mr.H 阅读(239) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; struct node { int w, lc, rc, h; }t[M]; int merge(int A, int B) { if(!A) return B; if(!B) return A; if(t[A].w < t[B].w) swap(A, B); t[A... 阅读全文
posted @ 2017-10-31 16:33 探险家Mr.H 阅读(136) 评论(0) 推荐(0) 编辑
摘要: “Tarjan有三种算法 你们知道吗”——Tar乙己 void tarjan(int x) { low[x]=dfn[x]=++ind; q[++top]=x;mark[x]=1; for(int i=last[x];i;i=e[i].next) if(!dfn[e[i].to]) { tarjan 阅读全文
posted @ 2017-10-31 15:09 探险家Mr.H 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 知名美食家小 A被邀请至ATM 大酒店,为其品评菜肴。 ATM 酒店为小 A 准备了 N 道菜肴,酒店按照为菜肴预估的质量从高到低给予1到N的顺序编号,预估质量最高的菜肴编号为1。 由于菜肴之间口味搭配的问题,某些菜肴必须在另一些菜肴之前制作,具体的,一共有 M 条形如”i 号菜肴'必须'先于 j 阅读全文
posted @ 2017-10-30 20:26 探险家Mr.H 阅读(169) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #define P pair #define mp(a,b) make_pair(a,b) using namespace std; const int maxn=500100; int first[maxn],to[maxn],next[maxn],cnt,val[ma... 阅读全文
posted @ 2017-10-30 20:26 探险家Mr.H 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include using namespace std; const int maxn=50010; int first[maxn],to[maxn],next[maxn],cnt; inline int read() { int x=0,f=1; char ch=get... 阅读全文
posted @ 2017-10-30 20:10 探险家Mr.H 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Do u like 玩♂游♂戏? lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示。当他使用某种装备时,他只能使用该装备的某一个属性。并且每种装备最多只能使用一次。游戏进行到最后,lxhgww遇到了终极boss,这个终极b 阅读全文
posted @ 2017-10-26 17:26 探险家Mr.H 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 题意: 给定一棵树上的边和点权 改动点权使得每个父节点u容量为子节点容量的d[u](子节点个数)倍 考察点: 1.这是一道语文题 2.点权很大 直接算会爆 有一种优化办法:取log(醉 这是什么优化) 3.确定一个点的权值 整棵树的权值都可以确定 4.由3.可以得到一个脑洞很大的算法:算出每个点不变 阅读全文
posted @ 2017-10-26 00:27 探险家Mr.H 阅读(150) 评论(0) 推荐(0) 编辑
摘要: dinic 码着 #include<stdio.h> #include<string.h> #include<iostream> using namespace std; const int inf=0x7fffffff; const int N=100000; int head[N]; int l 阅读全文
posted @ 2017-10-23 20:56 探险家Mr.H 阅读(138) 评论(0) 推荐(0) 编辑