自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 P3384树链剖分模板

#include <bits/stdc++.h> #define lson rt << 1 #define rson rt << 1 | 1 #define int long long using namespace std; const int maxn = 1e5 + 10; struct Edge { int next, to; } edges[max...

2019-06-04 19:17:33 118

原创 hdu4578线段树维护平方和,立方和(加,乘,赋值)

#include<bits/stdc++.h> #define ll unsigned long long using namespace std; const ll INFINITE = INT_MAX; const ll MAXNUM = 100005*4; ll mod=10007; struct segNode { ll p1,p2,p3; ll l,r; ...

2018-11-12 09:37:32 571

原创 AC自动机

链接:http://acm.hdu.edu.cn/showproblem.php?pid=2222 #include&lt;bits/stdc++.h&gt; using namespace std; const int maxn=1000005; const int tot=500005; struct Aho { struct node { int next...

2018-10-13 22:20:58 134

原创 莫队算法

 题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=2038 #include&lt;bits/stdc++.h&gt; #define ll long long using namespace std; int a[50005],be[50005],sum[50005]; int n,m,ans; ll GCD(ll a,ll b) ...

2018-10-13 22:20:46 119

转载 强连通分量模板

 https://www.cnblogs.com/five20/p/7594239.html原地址 #include &lt;cstdio&gt; #include &lt;stack&gt; #include &lt;cstring&gt; #include &lt;iostream&gt; using namespace std; int n,m,idx=0,k=1,Bcnt=0; int...

2018-10-13 22:20:39 97

原创 简单计算器

简单计算器 #include&lt;bits/stdc++.h&gt; using namespace std; char pre[7][7]= { '&gt;','&gt;','&lt;','&lt;','&lt;','&gt;','&gt;', '&gt;','&gt;','&lt;','&lt;','&lt;','&gt;','&gt;', '&a

2018-10-13 22:20:34 104

原创 后缀数组

uva11107 #include&lt;iostream&gt; #include&lt;algorithm&gt; #include&lt;cstring&gt; #include&lt;cstdio&gt; #include&lt;vector&gt; #include&lt;stack&gt; #include&lt;queue&gt; #include&lt;cmath&am

2018-10-13 22:20:29 81

原创 最小费用最大流

#include&lt;bits/stdc++.h&gt; #define maxm 50000 #define inf 1e8 using namespace std; const int maxn = 200; const double eps = 1e-7; const float EXP = exp(1.0); int num, head[maxn]; ///邻接表头结点 str...

2018-10-13 22:20:21 355 1

原创 poj2186强连通分量缩点

#include &lt;cstdio&gt; #include &lt;stack&gt; #include &lt;cstring&gt; #include &lt;iostream&gt; using namespace std; const int maxn=10005; int n,m,idx,k,Bcnt; int head[maxn]; int ins[maxn]; int dfn...

2018-10-13 22:20:07 102

原创 poj1523割点模板和桥

 http://poj.org/problem?id=1523 #include &lt;iostream&gt; #include &lt;cstdio&gt; #include &lt;algorithm&gt; #include &lt;cstring&gt; #include &lt;string&gt; #include &lt;cmath&gt; #include &lt;vect...

2018-10-13 22:20:02 136

原创 边双连通+缩点

poj3352  #include &lt;iostream&gt; #include &lt;cstdio&gt; #include &lt;algorithm&gt; #include &lt;cstring&gt; #include &lt;string&gt; #include &lt;cmath&gt; #include &lt;vector&gt; using namespace

2018-10-13 22:19:57 304

原创 最小割最小割边

http://acm.hdu.edu.cn/showproblem.php?pid=6214  #include&lt;bits/stdc++.h&gt; using namespace std; const int maxn=1005; const int INF=0x3fffffff; struct Edge { int from,to,cap,flow; }; struct Di...

2018-09-11 00:29:07 336

原创 线段树hdu1166

http://acm.hdu.edu.cn/showproblem.php?pid=1166  #include&lt;bits/stdc++.h&gt; using namespace std; const int INFINITE = INT_MAX; const int MAXNUM = 50005*4; struct stNode { int val; int l,r;...

2018-09-10 17:32:39 116

原创 白皮书328dijkstra模板

#include&lt;bits/stdc++.h&gt; using namespace std; const int maxn=2005; const int INF=0x3fffffff; struct Edge { int from,to,dist; }; struct HeapNode { int d,u; bool operator &lt;(const He...

2018-09-10 17:30:57 194

原创 刘汝佳最小花费最大流

https://www.nowcoder.com/acm/contest/207/G #include<bits/stdc++.h> #define esp 1e-7 using namespace std; const int maxn=205; const int INF=0x3fffffff; struct Edge { int from,to,cap,flow; ...

2018-09-10 17:30:47 206

原创 树状数组模板

int bit[MAXN],n,a[MAXN],m; int lowbit(int x) { return x&amp;(-x); } void add(int i,int x) { while(i&lt;=n) { bit[i]+=x; i+=lowbit(i); } } int sum(int i) { int s=0;...

2018-09-10 17:30:40 81

原创 k短路

 https://nanti.jisuanke.com/t/31445 #include&lt;iostream&gt; #include&lt;queue&gt; #include &lt;string.h&gt; #include&lt;algorithm&gt; #define MAXN 1010 using namespace std; const int inf=0x3f3f3f3...

2018-09-10 17:30:30 288

原创 白皮书最大流算法应用题

 一,无源网络流的建模 https://www.luogu.org/problemnew/show/P1231  题意,给你n1本书,n2本练习册,n3本答案,给你这些书和答案对应关系,问你最多能组成多少本书册。 由于需要书,练习册,答案三件套才能组成完整书册,将书复制成两份,一份与练习册建立边,一份与答案建立边, 建立源点和汇点,跑一边最大流就能解决 #include&lt;bits...

2018-09-10 17:27:44 253

空空如也

空空如也

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

TA关注的人

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