
数据结构-线段树与树状数组
文章平均质量分 84
2997ms
这个作者很懒,什么都没留下…
展开
-
几道简单的线段树入门题 POJ3264&&POJ3468&&POJ2777
Balanced LineupTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 40687 Accepted: 19137Case Time Limit: 2000MSDescriptionFor the daily milking, Far原创 2015-09-28 23:13:39 · 334 阅读 · 0 评论 -
Codeforces 672E:Ultimate Weirdness of an Array 线段树
E. Ultimate Weirdness of an Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYasin has an array a cont原创 2016-05-16 22:33:36 · 1157 阅读 · 4 评论 -
Codeforces 628E:Zbazi in Zeydabad 树状数组的奇妙用法
E. Zbazi in Zeydabadtime limit per test5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputA tourist wants to visit country Zeyda原创 2016-02-29 23:42:13 · 923 阅读 · 0 评论 -
Codeforces 351D:Jeff and Removing Periods
D. Jeff and Removing Periodstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputCosider a sequence, consisting原创 2016-02-04 13:31:04 · 802 阅读 · 0 评论 -
POJ 2985:The k-th Largest Group 树状数组求第K小的元素
The k-th Largest GroupTime Limit: 2000MS Memory Limit: 131072KTotal Submissions: 8278 Accepted: 2692DescriptionNewman likes playing with cats. He possesses lots原创 2016-02-12 10:27:39 · 151 阅读 · 0 评论 -
51nod 1463:找朋友 线段树
1463 找朋友基准时间限制:1.5 秒 空间限制:262144 KB 分值: 80 难度:5级算法题 收藏 取消关注给定:两个长度为n的数列A 、B一个有m个元素的集合K询问Q次每次询问[l,r],输出区间内满足|Bi-Bj|∈K 的最大Ai+Aj数据约定:n,Qm 011保证B[i]原创 2015-12-07 22:26:55 · 956 阅读 · 0 评论 -
HDU 5592:ZYB's Premutation 树状数组+二分
ZYB's Premutation Accepts: 218 Submissions: 983 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)问题描述ZYBZYB有一个排列PP,但他只记得PP中每个前缀区间的逆序对数,现在他原创 2015-12-06 10:45:36 · 741 阅读 · 0 评论 -
POJ 1151:Atlantis 线段树+扫描线
AtlantisTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 19374 Accepted: 7358DescriptionThere are several ancient Greek texts that contain descriptions原创 2015-10-04 12:36:06 · 364 阅读 · 0 评论 -
51nod 1394:差和问题
1394 差和问题基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注有一个集合S,初始状态下有n个元素,对他进行如下操作:1、向S里面添加一个值为v的元素。输入格式为1 v2、向S里面删除一个值为v的元素。输入格式为2 v3、询问S里面的元素两两之差绝对值之和。输入格原创 2015-12-02 13:26:01 · 914 阅读 · 0 评论 -
POJ 2155:Matrix 二维树状数组
MatrixTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 21757 Accepted: 8141DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j]原创 2015-10-09 11:59:54 · 395 阅读 · 0 评论 -
51nod 1208 && POJ 2482:Stars in Your Window
1208 Stars in Your Window题目来源: Poj基准时间限制:2 秒 空间限制:131072 KB 分值: 160 难度:6级算法题 收藏 取消关注整点上有N颗星星,每颗星星有一个亮度。用一个平行于x轴和y轴,宽为W高为H的方框去套星星。套住的所有星星的亮度之和为S(包括边框上的星星),求S的最大值。原创 2015-10-08 10:58:02 · 886 阅读 · 0 评论 -
HDU 5475:An easy problem 这题也能用线段树做???
An easy problemTime Limit: 8000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 467 Accepted Submission(s): 258Problem DescriptionOne day, a u原创 2015-09-27 10:21:19 · 429 阅读 · 0 评论 -
51nod 1206:Picture 求覆盖周长
1206 Picture题目来源: IOI 1998基准时间限制:2 秒 空间限制:131072 KB 分值: 160 难度:6级算法题 收藏 关注给出平面上的N个矩形(矩形的边平行于X轴和Y轴),求这些矩形组成的所有多边形的周长之和。例如:N = 7。(矩形会有重叠的地方)。合并后的多边形:原创 2015-10-06 11:31:06 · 1071 阅读 · 5 评论 -
POJ 3321:Apple Tree 树状数组
Apple TreeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 22131 Accepted: 6715DescriptionThere is an apple tree outside of kaka's house. Every autumn,原创 2015-10-04 14:12:03 · 491 阅读 · 0 评论 -
POJ 1195:Mobile phones 二维树状数组
Mobile phonesTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 16893 Accepted: 7789DescriptionSuppose that the fourth generation mobile phone base stati原创 2015-10-04 22:30:07 · 348 阅读 · 0 评论 -
POJ 2309:BST lowbit
BSTTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9140 Accepted: 5580DescriptionConsider an infinite full binary search tree (see the figure below),原创 2015-10-01 12:25:20 · 416 阅读 · 0 评论 -
POJ 2182&& POJ 2828:Lost Cows 从后往前 线段树
Lost CowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10544 Accepted: 6754DescriptionN (2 <= N <= 8,000) cows have unique brands in the range 1..N.原创 2015-09-30 19:33:40 · 321 阅读 · 0 评论 -
POJ 2481:Cows 树状数组
CowsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 14906 Accepted: 4941DescriptionFarmer John's cows have discovered that the clover growing along th原创 2015-09-30 09:24:11 · 729 阅读 · 0 评论 -
51nod1685:第K大区间2
1685 第K大区间2基准时间限制:1.5 秒 空间限制:131072 KB 分值: 160 难度:6级算法题 收藏 关注定义一个长度为奇数的区间的值为其所包含的的元素的中位数。中位数_百度百科 现给出n个数,求将所有长度为奇数的区间的值排序后,第K大的值为多少。样例解释:[l,r]表示区间的值原创 2016-06-02 19:03:18 · 1039 阅读 · 0 评论