自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 资源 (1)
  • 收藏
  • 关注

原创 HDU4812-D Tree-树分治

题目描述There is a skyscraping tree standing on the playground of Nanjing University of Science and Technology. On each branch of the tree is an integer (The tree can be treated as a connected graph wit...

2020-01-18 14:58:49 217

原创 最大流-Dinic算法模板

const int INF=0x3f3f3f3f;struct Edge{ int from,to,cap,flow; Edge(int _from,int _to,int _cap,int _flow):from(_from),to(_to),cap(_cap),flow(_flow){}};struct Dinic{ int s,t; vector<Edge> ...

2020-01-17 15:24:12 135

原创 Gym - 101981I-MagicPotion-最大流

题目描述There are n heroes and m monsters living in an island. The monsters became very vicious these days, so the heroes decided to diminish the monsters in the island. However, the i-th hero can only ...

2020-01-17 15:21:54 164

原创 HDU5977-Garden of Eden-树分治+FWT

题目描述When God made the first man, he put him on a beautiful garden, the Garden of Eden. Here Adam lived with all animals. God gave Adam eternal life. But Adam was lonely in the garden, so God made Ev...

2020-01-17 10:19:00 299

原创 POJ2114-Boatherds-树分治

题目描述Boatherds Inc. is a sailing company operating in the country of Trabantustan and offering boat trips on Trabantian rivers. All the rivers originate somewhere in the mountains and on their way do...

2020-01-16 15:22:48 159

原创 Prime Distance On Tree-树分治+FFT

题目描述Problem description.You are given a tree. If we select 2 distinct nodes uniformly at random, what’s the probability that the distance between these 2 nodes is a prime number?InputThe first li...

2020-01-16 10:31:28 328

原创 聪聪可可-点分治

聪聪和可可是兄弟俩,他们俩经常为了一些琐事打起来,例如家中只剩下最后一根冰棍而两人都想吃、两个人都想玩儿电脑(可是他们家只有一台电脑)……遇到这种问题,一般情况下石头剪刀布就好了,可是他们已经玩儿腻了这种低智商的游戏。他们的爸爸快被他们的争吵烦死了,所以他发明了一个新游戏:由爸爸在纸上画n个“点”,并用n-1条“边”把这n个“点”恰好连通(其实这就是一棵树)。并且每条“边”上都有一个数。接下来由...

2020-01-15 15:28:03 186

原创 POJ 1741tree-点分治入门

学习了一下点分治,如果理解有误还请不吝赐教。为了快速求得树上任意两点之间距离满足某种关系的点对数,我们需要用到这种算法。点分治是树上的一种分治算法,依靠树和子树之间的关系进行分治从而降低复杂度。和其他树上的算法有一些区别的是,点分治算法不是先处理局部信息,再将他们汇总得到整个树的信息。点分治处理的问题一般不是树整体的信息,而是树上局部的关系,这就导致我们不能将它看作一个整体,而应该从一开始就...

2020-01-15 14:09:40 230

原创 FWT模板

void FWT(int *a,int N,int opt){ for(int i=1;i<N;i<<=1) for(int p=i<<1,j=0;j<N;j+=p) for(int k=0;k<i;++k) /*or if(opt...

2020-01-14 15:24:25 132

原创 FFT模板

整理了一下,自己写了一下模板struct complex{ double r,i; complex(double _r=0,double _i=0):r(_r),i(_i){} complex operator +(const complex &b) { return complex(r+b.r,i+b.i); } complex operator -(const c...

2020-01-14 14:30:25 268

原创 UVa12633-Super Rooks on Chessboard-容斥+FFT

题目大意就是给你一个R*C的棋盘,上面有超级兵,这种超级兵会攻击 同一行、同一列、同一主对角线的所有元素,现在给你N个超级兵的坐标,需要你求出有多少方块是不能被攻击到的(R,C,N<50000)遇到这种计数问题就要联想到容斥(组合数学太重要了),由容斥原理:被攻击的方块数=行被攻击的方块数+列被攻击的方块数+主对角线被攻击的方块数-同时被行、列攻击的方块数-同时被行、对角线攻击的方块...

2020-01-14 09:29:24 185

原创 HDU4609 3-idiots-FFT

King OMeGa catched three men who had been streaking in the street. Looking as idiots though, the three men insisted that it was a kind of performance art, and begged the king to free them. Out of hat...

2020-01-13 13:56:01 220

原创 Tree Intersection-树启发式合并

Bobo has a tree with n vertices numbered by 1,2,…,n and (n-1) edges. The i-th vertex has color c i, and the i-th edge connects vertices a i and b i.Let C(x,y) denotes the set of colors in subtree ro...

2020-01-11 17:59:41 185

原创 树启发式合并入门

所谓启发式合并,就是一种符合直觉的合并方法:将小的子树合并在大的子树上。这些问题一般是相似的问题背景:都是树上的计数问题,都不能直接从上往下进行暴力,都需要从下往上计数时对子树信息进行运算从而得到父亲节点的信息。这个运算一般是启发式合并。一般使用map保存子树的一些信息,例如树的颜色,树孩子的多少等等。选择map的原因我认为有以下几点:map可以非常方便地保存离散的信息,而且可以对这些离散...

2020-01-11 17:51:57 172

原创 数据分割-并查集+set

小w来到百度之星的赛场上,准备开始实现一个程序自动分析系统。这个程序接受一些形如xi=xj 或 xi≠xj的相等/不等约束条件作为输入,判定是否可以通过给每个 w 赋适当的值,来满足这些条件。输入包含多组数据。然而粗心的小w不幸地把每组数据之间的分隔符删掉了。他只知道每组数据都是不可满足的,且若把每组数据的最后一个约束条件去掉,则该组数据是可满足的。请帮助他恢复这些分隔符。In...

2020-01-11 11:14:32 335

原创 HDU1512 Monkey King-左偏树+并查集

Once in a forest, there lived N aggressive monkeys. At the beginning, they each does things in its own way and none of them knows each other. But monkeys can’t avoid quarrelling, and it only happens ...

2020-01-11 11:05:48 157

原创 BZOJ2809-左偏树合并

Description在一个忍者的帮派里,一些忍者们被选中派遣给顾客,然后依据自己的工作获取报偿。在这个帮派里,有一名忍者被称之为 Master。除了 Master以外,每名忍者都有且仅有一个上级。为保密,同时增强忍者们的领导力,所有与他们工作相关的指令总是由上级发送给他的直接下属,而不允许通过其他的方式发送。现在你要招募一批忍者,并把它们派遣给顾客。你需要为每个被派遣的忍者 支付一定的薪水,...

2020-01-10 15:54:10 234

bandicam 2020-05-04 15-22-58-050.mp4

该视频是我汇编课程设计实验的运行结果,为了方便在博客中展示运行结果进行上传,没有什么用,啦啦啦啦啦啦

2020-05-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除