- 博客(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 519
原创 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 439
原创 HNOI2002 营业额统计 Splay树 单点更新模板
营业额统计Description营业额统计 Tiger最近被公司升任为营业部经理,他上任后接受公司交给的第一项任务便是统计并分析公司成立以来的营业情况。 Tiger拿出了公司的账本,账本上记录了公司成立以来每天的营业额。分析营业情况是一项相当复杂的工作。由于节假日,大减价或者是其他情况的时候,营业额会出现一定的波动,当然一定的波动是能够接受的,但是在某些时候营业额突变得很高或是很低
2015-05-12 08:34:14 355
原创 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 382
原创 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 560
原创 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 381
原创 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 393
原创 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 385
原创 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 351
原创 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 298
原创 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 348
原创 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 376
原创 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 679
原创 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 262
原创 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 343
原创 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 867
原创 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 311
原创 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 456
原创 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 374
原创 hdu4862(14多校第一场B题)及最小费用最大流模板
解题思路:建立一个流量网络,一个二部图。X部分向Y部分链接的情况表示可以从一个点跳到另一个点,超级源点和超级汇点分别同X部分的点和Y部分的点链接。在X部分中多加一个点它与源点的流量是K费用是0,与Y部分所有点链接流量是1费用是0。这表示操作K次。
2014-07-24 10:11:49 413
原创 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 275
原创 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 328
原创 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 464
原创 线段树个人模板
第一段代码:维护区间内最大值(单点维护)#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 419 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人