
线段树
crazy理工科
AC之路
展开
-
敌兵布阵(线段树)
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 452 Accepted Submission(s): 275Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Ti原创 2017-08-18 16:07:31 · 151 阅读 · 0 评论 -
蓝桥杯 :区间k大数查询 (主席树)
算法训练 区间k大数查询 时间限制:1.0s 内存限制:256.0MB问题描述 给定一个序列,每次询问序列中第l个数到第r个数中第K大的数是哪个。输入格式 第一行包含一个数n,表示序列长度。第二行包含n个正整数,表示给定的序列。第三个包含一个正整数m,表示询问个数。接下来m行,每行三个数l,r,K,表示询问序列从左往右第l个数到第r个数中,从大往小第K大的数是哪个。序...原创 2018-03-26 20:12:10 · 281 阅读 · 0 评论 -
主席树
#include<iostream>#include<string.h>#include<stdio.h>#include<vector>#include<algorithm>using namespace std;#define maxn 100007struct Node{ int l,r,sum;}T[maxn*40];//线段树一般开4倍 主席树一般开40倍sint原创 2017-12-15 17:10:38 · 145 阅读 · 0 评论 -
Can you answer these queries V(线段树区间和问题)
You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| <= 10000 , 1 <= N <= 10000 ). A query is defined as follows: Query(x1,y1,x2,y2) = Max { A[i]+A[i+1]+...+A[j] ; x1 <= i <= y1 , x2 <= j <= y2 an原创 2017-11-24 17:29:54 · 356 阅读 · 0 评论 -
Color the ball(线段树)
Color the ball Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 24116 Accepted Submission(s): 11731Problem Description N个气球排成一排,从左到右依次编号为1,原创 2017-12-08 16:39:55 · 278 阅读 · 0 评论 -
Super Mario(线段树 + 离散化)
Super Mario Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7756 Accepted Submission(s): 3322Problem Description Mario is world-famous plu原创 2017-11-30 15:15:10 · 386 阅读 · 0 评论 -
Tunnel Warfare(线段树区间合并问题)
Tunnel Warfare Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10310 Accepted Submission(s): 4047Problem Description During the War of Res原创 2017-11-18 16:35:01 · 186 阅读 · 0 评论 -
Can you answer these queries IV(线段树区间和)
You are given a sequence A of N(N <= 100,000) positive integers. There sum will be less than 1018. On this sequence you have to apply M (M <= 100,000) operations:(A) For given x,y, for each el...原创 2017-11-18 15:06:10 · 316 阅读 · 0 评论 -
敌兵布阵(线段树)
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 102027 Accepted Submission(s): 43109Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子原创 2017-11-03 17:00:20 · 262 阅读 · 0 评论 -
Color the ball(线段树)
Color the ball Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 23799 Accepted Submission(s): 11570Problem Description N个气球排成一排,从左到右依次编号为1,原创 2017-11-03 16:26:01 · 308 阅读 · 0 评论 -
Can you answer these queries III (区间和问题)
You are given a sequence A of N (N <= 50000) integers between -10000 and 10000. On this sequence you have to apply M (M <= 50000) operations:modify the i-th element in the sequence or for given x y pr原创 2017-11-11 18:16:36 · 734 阅读 · 0 评论 -
Can you answer these queries I (线段树)
You are given a sequence A[1], A[2], ..., A[N] . ( |A[i]| ≤ 15007 , 1 ≤ N ≤ 50000 ). A query is defined as follows:Query(x,y) = Max { a[i]+a[i+1]+...+a[j] ; x ≤ i ≤ j ≤ y }.Given M queries, your pro...原创 2017-11-11 15:09:48 · 801 阅读 · 0 评论 -
I Hate It(线段树)
I Hate ItTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 85326 Accepted Submission(s): 32731Problem Description 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到原创 2017-11-02 11:43:48 · 184 阅读 · 0 评论 -
Billboard(线段树区间最大值)
Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 24414 Accepted Submission(s): 10040Problem Description At the entrance to the u原创 2017-08-25 10:57:35 · 269 阅读 · 0 评论 -
K-th Number(主席树)
K-th Number Time Limit: 20000MS Memory Limit: 65536K Total Submissions: 64473 Accepted: 22684 Case Time Limit: 2000MS DescriptionYou are working for Macrohard company in data structur...原创 2018-04-12 20:30:54 · 1400 阅读 · 0 评论