自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 E. GukiZ and GukiZianap平方分桶

E. GukiZ and GukiZianatime limit per test10 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputProfessor GukiZ was playing with ar

2015-07-02 08:55:50 514

原创 POJ 3580 SuperMemo Splay树各种区间操作

SuperMemoTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 11106 Accepted: 3494Case Time Limit: 2000MSDescriptionYour friend, Jackson is invited t

2015-05-15 20:01:31 428

原创 HNOI2002 营业额统计 Splay树 单点更新模板

营业额统计Description营业额统计 Tiger最近被公司升任为营业部经理,他上任后接受公司交给的第一项任务便是统计并分析公司成立以来的营业情况。 Tiger拿出了公司的账本,账本上记录了公司成立以来每天的营业额。分析营业情况是一项相当复杂的工作。由于节假日,大减价或者是其他情况的时候,营业额会出现一定的波动,当然一定的波动是能够接受的,但是在某些时候营业额突变得很高或是很低

2015-05-12 08:34:14 352

原创 poj151 Atlantics 扫描线+线段树+离散化

AtlantisTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18661 Accepted: 7082DescriptionThere are several ancient Greek texts that contain descriptions o

2015-05-07 10:42:49 374

原创 ACdream 字符串专题A Gao the string! EXKMP+矩阵快速幂

A - Gao the string!Time Limit: 2000/1000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Others)Submit StatusProblem Descriptiongive you a string, please output the result of the

2015-05-07 10:38:17 555

原创 HDU2222 Keywords Search AC自动机模板题

Keywords SearchTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 40607    Accepted Submission(s): 12928Problem DescriptionIn the m

2015-04-24 11:26:42 375

原创 codeforces E. A and B and Lecture Rooms

A and B are preparing themselves for programming contests.The University where A and B study is a set of rooms connected by corridors. Overall, the University has n rooms connected by n - 1corrido

2015-04-10 12:10:31 385

原创 codeforces C. Watto and Mechanism 字典树

C. Watto and Mechanismtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWatto, the owner of a spare parts st

2015-02-16 16:05:36 379

原创 spoj375Query on a tree

题意:Problem code: QTREEYou are given a tree (an acyclic undirected connected graph) withN nodes, and edges numbered 1, 2, 3...N-1.We will ask you to perfrom some instruc

2015-02-13 17:06:41 346

原创 poj1741树分治

TreeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 11912 Accepted: 3755DescriptionGive a tree with n vertices,each edge has a length(positive integer

2015-02-09 23:53:41 293

原创 hdu4009 SBT模板

题意:非常简单,给定n和k,一共有n个操作,I表示向其中插入元素,q表示询问第k大的数。解题:非常简单,可以维护一个k大小的堆即可,为了验证模板,用了SBT//// main.cpp// hdu4009//// Created by 蘇與軒 on 15/2/7.// Copyright (c) 2015年 蘇與軒. All rights reserved.//#inc

2015-02-07 17:18:24 344

原创 hdu2673在线LCA算法+树状数组

题意:给定一棵树求指定两个点之间的距离,以及修改某一条边的权值解法:要求两个点之间的距离,显然直接找到这两个点的lca,设这个点为x显然u和v之间的距离为dist[u]+dist[v]-2*dist[x]。其中dist存的是根到u的距离。只是由于存在权值的变动,所以需要加入树状数组作为维护。具体细节见代码//// main.cpp// poj2763//// Created

2015-02-07 15:54:58 368

原创 hdu2596LCA公共祖先问题(离线Tarjan算法)

最近公共祖先问题~~题目大意:一个村子里有n个房子,这n个房子用n-1条路连接起来,接下了有m次询问,每次询问两个房子a,b之间的距离是多少。很明显的最近公共祖先问题,先建一棵树,然后求出每一点i到树根的距离dis[i],然后每次询问a,b之间的距离=dis[a]+dis[b]-2*dis[LCA(a,b)];LCA(a,b)即是a,b的最近公共祖先。。对于

2015-02-05 00:19:22 670

原创 poj2186强连通分量分解

DescriptionEvery cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs of the form (A, B) that t

2015-02-04 00:02:05 252

原创 codeforces Round#288D Tanya and Password 欧拉通路

D. Tanya and Passwordtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWhile dad was at work, a little girl

2015-01-29 23:02:40 337

原创 HDU3031及左偏树模板

//// main.cpp// leftist-tree//// Created by 蘇與軒 on 15/1/28.// Copyright (c) 2015年 蘇與軒. All rights reserved.//#include #include #include #include #include #include #include #include

2015-01-28 16:25:02 863

原创 POJ2104 归并树

题目大意:求区间内第k大的数解法:归并树,ji'ui

2014-10-10 20:05:16 275

原创 hdu 4941Magic Forest离散化

题意:

2014-08-15 09:53:58 377

原创 HDU4927 Series 1(14年多校练习G题)高精度模板

题意:Problem DescriptionLet A be an integral series {A1, A2, . . . , An}.The zero-order series of A is A itself.The first-order series of A is {B1, B2, . . . , Bn-1},where Bi = Ai+1 -

2014-08-08 11:33:31 304

原创 HDU4902 Nice Boat(14多校联合4-1006)线段树区间更新

Nice boatTime Limit: 30000/15000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1743    Accepted Submission(s): 314Problem Description There is a

2014-08-02 11:45:14 451

原创 hdu3836及Tarjon算法模板

学了一下Tarjon求强连通分量的

2014-07-26 11:34:51 436

原创 hdu3879及ISAP模板(链式前向星)

题意不多说了,解题思路详见胡波涛的《最小割模型在信息学竞赛的应用》论文

2014-07-25 13:55:42 500

原创 hdu3829及二分图最大匹配模板

老题目了,复习了一下匈牙利算法。#include#include#include#include#include#include#define rep(i,a,b) for (int i=a;i<(b+1);i++)using namespace std;int n,m,k;string a[505],b[505];vector v[505];int pre[505]={

2014-07-24 14:53:57 370

原创 hdu4862(14多校第一场B题)及最小费用最大流模板

解题思路:建立一个流量网络,一个二部图。X部分向Y部分链接的情况表示可以从一个点跳到另一个点,超级源点和超级汇点分别同X部分的点和Y部分的点链接。在X部分中多加一个点它与源点的流量是K费用是0,与Y部分所有点链接流量是1费用是0。这表示操作K次。

2014-07-24 10:11:49 410

原创 hdu3549及最大流ISAP模板

经过了几天的细心研究,终于把ISAP写出来了,直接上代码

2014-07-23 09:01:16 438

原创 hdu3549及最大流dinic模板

邻接表实现的最大流裸题上代码:

2014-07-11 16:35:56 445

原创 poj1273及最大流Edmond karp算法模板

最大流裸题,不多说。AC代码如下:#include#include#include#include#include#include#include#define rep(i,a,b) for (int i=a;i<=b;i++)using namespace std;int map[250][250];bool vis[250]={false};int pre[250

2014-07-11 00:22:05 269

原创 hdu1879及最小生成树模板

这个也可以看做是并查集模板,主要是并查集,其中加入了rrank数组优化

2014-07-10 12:22:33 301

原创 hdu1285及拓扑排序模板

上代码:#include#include#include#include#include#include#define rep(i,n) for (int i=1;i<=n;i++)using namespace std;int indrg[600];vector map[600],ans;int mp[505][505];int n,m;int main(){

2014-07-10 12:20:17 322

原创 hdu2544及spfa模板

直接po代码:#include#include#include#include#include#include#define rep(i,n) for (int i=1;i<=n;i++)using namespace std;struct P{ int v,w;};vector map[150];int n,m;int dis[150]={0};int

2014-07-10 12:19:35 459

原创 poj1195及二维树状数组模板

题意在poj里有,我就不累述了,反正就是一个二维树状数组的裸题。

2014-07-10 08:08:16 397

原创 hdu1166及树状数组模板

树状数组关键的两个函数如下,这两个函数掌握了,树状数组也就掌握了。具体原理各个大神都有了xia

2014-07-08 07:43:45 401 1

原创 线段树个人模板

第一段代码:维护区间内最大值(单点维护)#include#include#include#include#include#define rep(i,a,b) for (int i=a;iusing namespace std;const int Max=0x3f3f3f3f;struct Node{int maxi

2014-07-08 07:35:23 415 1

空空如也

空空如也

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

TA关注的人

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