
数据结构
Konago
这个作者很懒,什么都没留下…
展开
-
hdu 1166 敌兵布阵
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166不解释了,线段树经典例题。#include#include#include#include#includeusing namespace std;const int maxn = 400005;int Size, n, dat[2 * maxn];void in原创 2018-03-07 17:01:26 · 169 阅读 · 0 评论 -
HDU 1754 I Hate It
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1754裸线段树1:结点式存储#include#include#include#include#includeusing namespace std;const int maxn = 200005;int Size, n, m;struct line{ i原创 2018-03-07 21:33:18 · 184 阅读 · 0 评论 -
hdu 2795 Billboard
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2795线段树单点更新#include#include#include#include#includeusing namespace std;const int maxn = 200005;int Size, n, w, h;int H[maxn];struct line原创 2018-03-09 13:38:07 · 190 阅读 · 0 评论 -
poj 3468 A Simple Problem with Integers
题目链接:http://poj.org/problem?id=3468题意:给你N个数,然后有M个操作。有两种类型的操作,(1)“Ca b c”,表示将区间[a,b]里的数加上c。(2)“Q a b”,表示查询区间[a,b]的数的和区间维护线段树模板题 #include<iostream>#include<cstdio>#include<cstr...原创 2018-04-09 00:46:08 · 153 阅读 · 0 评论 -
Splay Tree(模板)
题目:https://www.luogu.org/problemnew/show/P3369 #include<bits/stdc++.h>//#define DEBUGusing namespace std;const int inf = 2e9 + 50;class node{public: node* ch[2], *fa; ...原创 2018-09-05 20:10:02 · 263 阅读 · 0 评论