自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 树状数组求kth大

int find_kth(int k)  {      int ans = 0, cnt = 0, i;      for (i = 20; i >= 0; i--)      {          ans += (1         if (ans >= MAXN|| cnt + c[ans] >= k)              ans -= (1       

2016-07-08 16:26:46 453

转载 叉积点积小模板

struct Point { int x,y; Point() {} Point(int _x,int _y) : x(_x),y(_y) {} Point operator - (const Point &rhs) const { return Point(x - rhs.x,y - rhs.y); } double length(

2016-01-19 14:31:46 331

原创 强联通模板

vector G[maxn];int pre[maxn],lowlink[maxn],sccno[maxn],dfs_clock,scc_cnt;stack S;void dfs(int u) {    pre[u]=lowlink[u]=++dfs_clock;    S.push(u);    for(int i=0;i        int v=G[u][i];

2015-11-18 14:20:07 432

原创 2-sat模板

bool dfs(int x) {    if(vis[x^1]) return 0;    if(vis[x]) return 1;    vis[x]=1;    S[c++]=x;    for(int i=0;i        if(!dfs(edge[x][i])) return 0;    }    return 1;}bool solve()

2015-10-30 20:56:43 366

原创 快速读入模板

int readint() {    char c = getchar();    while(!isdigit(c)) c = getchar();    int res = 0;    while(isdigit(c)) res = res * 10 + c - '0', c = getchar();    return res;}

2015-10-30 20:55:37 322

原创 后缀数组模板

int sa[N], rak[N], height[N];int wa[N], wb[N], wv[N], wd[N];int cmp(int *r, int a, int b, int l){    return r[a] == r[b] && r[a+l] == r[b+l];}void build_sa(int *r, int n, int m)  

2015-07-21 08:25:35 249

原创 ac自动机模板

template struct Aho_Corasick{    int ch[maxnode][sigma_size];    int val[maxnode],last[maxnode],f[maxnode];    int sz;    //int cnt[maxnode];    //bool mark[maxnode];    Aho_Corasick() {

2015-06-04 21:06:59 339

原创 凸包模板

typedef double flt;const flt eps = 1e-12, INF = 1e18, PI = acos(-1.0);flt sqr(flt x) {return x * x;}int sgn(flt x) {return x1:(x>eps);}flt fix(flt x) {return sgn(x)==0?0:x;}struct Point { flt x

2015-06-01 19:26:02 358

原创 费用流模板

templateint N,typename T> struct CostFlow { int s,t,head[N],etot,prevv[N],preve[N],inq[N],que[N],qf,qe; T dis[N]; struct Edge {int v,next; T cap,cost;} g[50

2015-05-27 16:50:07 415

原创 最大流模板2

templateint N,typename T> struct MaxFlow { int s,t,head[N],etot,que[N],qf,qe,dis[N],cur[N]; struct Edge {int v,next; T cap;}g[501000]; void init() { memset(head,-1,sizeof(head));

2015-05-27 00:03:35 405 1

原创 kmp模板

void getFail(char *s,int *num) {    int L=strlen(s);    int i=1,j=0;    for(;i            if(s[i]==s[j]) {                num[i]=j;                j++;            }            else if(

2015-05-26 23:55:21 356

原创 最大流模板

struct edge{    int to,cap,rev;    edge(int a,int b,int c) {        to=a,cap=b,rev=c;    }};vectorG[maxn];int level[maxn];int iter[maxn];void add_edge(int from,int to,int cap

2015-05-24 13:19:11 412

转载 vimrc 编辑

VIM 中可供用户定制的选项非常非常多,作为初学者,我们没有必要了解这么多东西。下面,滇狐简单列出了一些最常用的配置项,大家可以根据自己的需要将这些内容添加到自己的 .vimrc 中。1 基本设置set nocp 该命令指定让 VIM 工作在不兼容模式下。在 VIM 之前,出现过一个非常流行的编辑器叫 vi。VIM 许多操作与 vi 很相似,但也有许多操作与 vi 是不一样的。

2014-08-22 20:41:03 338

转载 vector用法

C++内置的数组支持容器的机制,但是它不支持容器抽象的语义。要解决此问题我们自己实现这样的类。在标准C++中,用容器向量(vector)实现。容器向量也是一个类模板。标准库vector类型使用需要的头文件:#include 。vector 是一个类模板。不是一种数据类型,vector是一种数据类型。Vector的存储空间是连续的,list不是连续存储的。一、 定义和初始化vecto

2014-08-21 19:00:44 262

原创 构造函数

struct node{int x,y;node()}

2014-08-06 11:21:38 301

空空如也

空空如也

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

TA关注的人

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