
数据结构题
文章平均质量分 85
安静de想着网名
300字以内
展开
-
acm 模板
卢卡斯定理 主席树 Sunday AC自动机 链式前向星#include<string.h>#define MAX 10000struct node{ int to,nex,wei;}edge[MAX*2+5];int head[MAX+5],cnt;void add(int u,int v,int w)//添加一个单向边u->v 权为w {...原创 2017-08-11 17:47:51 · 340 阅读 · 0 评论 -
Gym - 100971D==Laying Cables【单调栈】
One-dimensional country has n cities, the i-th of which is located at the point xi and has population pi, and all xi, as well as all pi, are distinct. When one-dimensional country got the Internet, it...原创 2018-07-21 21:53:27 · 393 阅读 · 0 评论 -
HDU3577【线段树+区间更新+最值查询】
Fast ArrangementProblem DescriptionChinese always have the railway tickets problem because of its’ huge amount of passangers and stations. Now goverment need you to develop a new tickets query s...原创 2018-07-18 20:39:51 · 686 阅读 · 0 评论 -
splay
#include<iostream>#include<stdio.h>#include<string>#include<string.h>#include<algorithm>using namespace std;const int MAXN = 100000 + 55;int L[MAXN], R[MAXN], F[MA...原创 2018-04-27 19:06:44 · 220 阅读 · 0 评论 -
树链剖分模板
#include<iostream>#include<stdio.h>#include<vector>#include<algorithm>#include<string.h>using namespace std;typedef long long LL;const int MAXN = 100000 + 5;LL aa...原创 2018-04-25 19:13:50 · 162 阅读 · 0 评论 -
BZOJ3384 模板题【树链剖分】
已知一棵包含N个结点的树(连通且无环),每个节点上包含一个数值,需要支持以下操作:操作1: 格式: 1 x y z 表示将树从x到y结点最短路径上所有节点的值都加上z操作2: 格式: 2 x y 表示求树从x到y结点最短路径上所有节点的值之和操作3: 格式: 3 x z 表示将以x为根节点的子树内所有节点值都加上z操作4: 格式: 4 x 表示求以x为根节点的子树内所有节点值之和原创 2018-04-25 19:05:09 · 217 阅读 · 0 评论 -
[USACO18JAN]MooTube【并查集】
Farmer John原创 2018-04-21 17:35:30 · 2549 阅读 · 0 评论 -
线段树(动态建点)
敌兵布阵原创 2018-03-05 18:24:08 · 429 阅读 · 0 评论 -
二维线段树之降维打击
COCI 2017/2018 ROUND#1DedaLittle Marica is making up a nonsensical unusual fairy tale and is telling to her grandfatherwho keeps interrupting her and asking her stupid intriguing questions.In Mar...原创 2018-03-12 12:21:19 · 491 阅读 · 0 评论 -
Yet Another Tree Query Problem(二维线段树)
Yet Another Tree Query Problem原创 2018-03-11 11:54:20 · 411 阅读 · 0 评论 -
主席树——区间第K大
Kth number原创 2017-09-27 21:51:33 · 317 阅读 · 0 评论 -
线段树plus
Just a HookHDU1698Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for mo原创 2017-09-20 16:22:50 · 250 阅读 · 0 评论 -
可持久化线段树——主席树
支持访问任意历史版本以及在历史版本上修改的数据结构 每次修改不是在原有线段树上直接修改,而是在旁边新建点。 时空复杂度都是O(mlogn) const int N = 100000 + 5;//点数long long tree[N * 25], add_num[N * 25];int total, left_child[N * 25], right_child[N * 25], r...原创 2017-08-14 18:32:49 · 398 阅读 · 0 评论 -
Call of Accepted【中缀表达式】2018ICPC沈阳网络赛
Call of AcceptedYou and your friends are at the table, playing an old and interesting game - the Call of Cthulhu. There is a mechanism in the game: rolling the dice. You use a notation to communica...原创 2018-09-08 18:52:10 · 361 阅读 · 0 评论