- 博客(18)
- 收藏
- 关注
原创 P3384树链剖分模板
#include <bits/stdc++.h>#define lson rt << 1#define rson rt << 1 | 1#define int long longusing namespace std;const int maxn = 1e5 + 10;struct Edge{ int next, to;} edges[max...
2019-06-04 19:17:33 123
原创 hdu4578线段树维护平方和,立方和(加,乘,赋值)
#include<bits/stdc++.h>#define ll unsigned long longusing 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 588
原创 AC自动机
链接:http://acm.hdu.edu.cn/showproblem.php?pid=2222#include<bits/stdc++.h>using namespace std;const int maxn=1000005;const int tot=500005;struct Aho{ struct node { int next...
2018-10-13 22:20:58 140
原创 莫队算法
题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=2038#include<bits/stdc++.h>#define ll long longusing 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 125
转载 强连通分量模板
https://www.cnblogs.com/five20/p/7594239.html原地址#include <cstdio>#include <stack>#include <cstring>#include <iostream>using namespace std;int n,m,idx=0,k=1,Bcnt=0;int...
2018-10-13 22:20:39 107
原创 简单计算器
简单计算器#include<bits/stdc++.h>using namespace std;char pre[7][7]={ '>','>','<','<','<','>','>', '>','>','<','<','<','>','>', '&a
2018-10-13 22:20:34 106
原创 后缀数组
uva11107#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>#include<vector>#include<stack>#include<queue>#include<cmath&am
2018-10-13 22:20:29 88
原创 最小费用最大流
#include<bits/stdc++.h>#define maxm 50000#define inf 1e8using 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 365 1
原创 poj2186强连通分量缩点
#include <cstdio>#include <stack>#include <cstring>#include <iostream>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 111
原创 poj1523割点模板和桥
http://poj.org/problem?id=1523#include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <string>#include <cmath>#include <vect...
2018-10-13 22:20:02 144
原创 边双连通+缩点
poj3352 #include <iostream>#include <cstdio>#include <algorithm>#include <cstring>#include <string>#include <cmath>#include <vector>using namespace
2018-10-13 22:19:57 312
原创 最小割最小割边
http://acm.hdu.edu.cn/showproblem.php?pid=6214 #include<bits/stdc++.h>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 345
原创 线段树hdu1166
http://acm.hdu.edu.cn/showproblem.php?pid=1166 #include<bits/stdc++.h>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 125
原创 白皮书328dijkstra模板
#include<bits/stdc++.h>using namespace std;const int maxn=2005;const int INF=0x3fffffff;struct Edge{ int from,to,dist;};struct HeapNode{ int d,u; bool operator <(const He...
2018-09-10 17:30:57 204
原创 刘汝佳最小花费最大流
https://www.nowcoder.com/acm/contest/207/G#include<bits/stdc++.h>#define esp 1e-7using namespace std;const int maxn=205;const int INF=0x3fffffff;struct Edge{ int from,to,cap,flow;...
2018-09-10 17:30:47 215
原创 树状数组模板
int bit[MAXN],n,a[MAXN],m;int lowbit(int x){ return x&(-x);}void add(int i,int x){ while(i<=n) { bit[i]+=x; i+=lowbit(i); }}int sum(int i){ int s=0;...
2018-09-10 17:30:40 90
原创 k短路
https://nanti.jisuanke.com/t/31445#include<iostream>#include<queue>#include <string.h>#include<algorithm>#define MAXN 1010using namespace std;const int inf=0x3f3f3f3...
2018-09-10 17:30:30 294
原创 白皮书最大流算法应用题
一,无源网络流的建模https://www.luogu.org/problemnew/show/P1231 题意,给你n1本书,n2本练习册,n3本答案,给你这些书和答案对应关系,问你最多能组成多少本书册。由于需要书,练习册,答案三件套才能组成完整书册,将书复制成两份,一份与练习册建立边,一份与答案建立边,建立源点和汇点,跑一边最大流就能解决#include<bits...
2018-09-10 17:27:44 265
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人