
线段树&树状数组
文章平均质量分 80
cyendra
Azarath Metrion Zinthos
展开
-
线段树 hdu 1754 I Hate It 单点更新 区间求最值
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23163 Accepted Submission(s): 9257Problem Description很多学校流行一种比较的习惯。老原创 2013-04-18 16:40:15 · 863 阅读 · 0 评论 -
SGU 180 Inversions 逆序数
--------------int n;int a[maxn];int b[maxn];struct BIT{ int n; int tree[maxn]; void init(int n){ this->n=n; memset(tree,0,sizeof(tree)); } int lowbit(int x){原创 2014-01-05 19:38:20 · 617 阅读 · 0 评论 -
【专题】线段树
单点更新最最基础的线段树,只更新叶子节点,然后把信息用PushUP(int r)这个函数更新上来。hdu1166 敌兵布阵线段树 hdu 1166 敌兵布阵 单点更新区间求和hdu1754 I Hate It线段树 hdu 1754 I Hate It 单点更新 区间求最值hdu1394 Minimum Inversion Numberhdu 1394原创 2013-05-12 17:33:58 · 1036 阅读 · 0 评论 -
【专题】树状数组
------------------------------挖坑。。。-------------------------------------------------------------------------------------------------------------------------------------------------原创 2013-09-17 21:47:08 · 698 阅读 · 0 评论 -
poj 1769 Minimizing maximizer 线段树优化的dp
Minimizing maximizerTime Limit: 5000MS Memory Limit: 30000KTotal Submissions: 3047 Accepted: 1187DescriptionThe company Chris Ltd. is preparing a new sorting ha原创 2013-09-03 21:27:41 · 1413 阅读 · 0 评论 -
MUTC 3 A - Flowers 树状数组
FlowersTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1829 Accepted Submission(s): 901Problem DescriptionAs is known to all,原创 2013-06-16 13:48:41 · 987 阅读 · 0 评论 -
线段树模板
单点更新,区间求最值#include#include#include#include#include#define N 222222using namespace std;int num[N];struct Tree{ int l; int r; int max;} tree[N*4];void push_up(int root原创 2013-05-12 19:03:59 · 671 阅读 · 0 评论 -
UVa 11992 - Fast Matrix Operations 成段更新,求最值与和
Problem FFast Matrix OperationsThere is a matrix containing at most 106 elements divided into r rows and c columns. Each element has a location (x,y) where 1<=x<=r,1<=y<=c. Initially, all the el原创 2013-05-14 18:26:48 · 954 阅读 · 0 评论 -
UVa 12299 - RMQ with Shifts 线段树 单点更新
RMQ with Shifts In the traditional RMQ (Range Minimum Query) problem, we have a static array A. Then for each query (L, R)(LR), we report the minimum value among A[L], A[L + 1], ..., A原创 2013-05-14 15:32:02 · 1479 阅读 · 0 评论 -
Poj 2528 Mayor's posters 线段树 离散化 成段更新
Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 32605 Accepted: 9469DescriptionThe citizens of Bytetown, AB, could not stand that the c原创 2013-05-13 15:59:56 · 856 阅读 · 0 评论 -
hdu 2795 Billboard 线段树 单点更新
BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6525 Accepted Submission(s): 2957Problem DescriptionAt the entrance原创 2013-05-12 20:01:34 · 983 阅读 · 0 评论 -
NEFU 700 Car race game 树状数组
Car race gameTime Limit 1000msMemory Limit 65536Kdescription Bob is a game programming specialist. In his new car race game, there are some r原创 2013-05-05 20:21:48 · 943 阅读 · 0 评论 -
Hdu 1542 Atlantis 线段树 求矩形面积并
AtlantisTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4691 Accepted Submission(s): 2095Problem DescriptionThere are several原创 2013-05-16 14:43:24 · 790 阅读 · 0 评论 -
Poj 3667 Hotel 线段树 区间合并
HotelTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 8968 Accepted: 3804DescriptionThe cows are journeying north to Thunder Bay in Canada to gain cult原创 2013-05-16 09:58:45 · 892 阅读 · 0 评论 -
hdu 1394 Minimum Inversion Number 线段树 逆序数
Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6365 Accepted Submission(s): 3875Problem DescriptionT原创 2013-04-19 18:19:56 · 930 阅读 · 0 评论 -
线段树 poj 3468 A Simple Problem with Integers 区间add更新
A Simple Problem with IntegersTime Limit: 5000MS Memory Limit: 131072KTotal Submissions: 41899 Accepted: 12169Case Time Limit: 2000MSDescriptionYou have N原创 2013-04-18 16:42:23 · 822 阅读 · 0 评论 -
线段树 1698 Just a Hook 区间set更新
Just a HookTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11297 Accepted Submission(s): 5591Problem DescriptionIn the game o原创 2013-04-18 16:41:22 · 697 阅读 · 0 评论 -
线段树 hdu 1166 敌兵布阵 单点更新区间求和
敌兵布阵Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25659 Accepted Submission(s): 11092Problem DescriptionC国的死对头A国这段时间正在进行军事演原创 2013-04-18 16:39:01 · 790 阅读 · 0 评论 -
ZOJ 3279 Ants 二分树状数组
----------const int maxn=110000;const int maxm=10000;int n,m;struct BIT{ int n; int tree[maxn]; void init(int n){ this->n=n; memset(tree,0,sizeof(tree)); } int原创 2014-01-12 20:38:14 · 648 阅读 · 0 评论