随笔分类 -  线段树和树状数组

上一页 1 2

HDU 1540 Tunnel Warfare(线段树,去最大连续区间)
摘要:Tunnel WarfareTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2396Accepted Submission(s): 886Problem DescriptionDuring the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally 阅读全文

posted @ 2012-08-15 21:55 kuangbin 阅读(4974) 评论(0) 推荐(2)

HDU 1698 Just a Hook(线段树,成段更新)
摘要:Just a HookTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9258Accepted Submission(s): 4510Problem DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecut 阅读全文

posted @ 2012-08-15 02:57 kuangbin 阅读(2466) 评论(0) 推荐(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): 4647Accepted Submission(s): 2809Problem DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai 阅读全文

posted @ 2012-08-15 02:11 kuangbin 阅读(4002) 评论(0) 推荐(1)

HDU 1166 敌兵布阵(线段树,树状数组)
摘要:敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18473Accepted Submission(s): 8034Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数 阅读全文

posted @ 2012-08-11 16:36 kuangbin 阅读(778) 评论(0) 推荐(0)

HDU 4027 Can you answer these queries?(线段树)
摘要:Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 4570Accepted Submission(s): 1087Problem DescriptionA lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to 阅读全文

posted @ 2012-08-11 09:49 kuangbin 阅读(1156) 评论(0) 推荐(0)

POJ 3264 Balanced Lineup(线段树)
摘要:Balanced LineupTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 23699Accepted: 11019Case Time Limit: 2000MSDescriptionFor the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with som 阅读全文

posted @ 2012-08-10 12:28 kuangbin 阅读(653) 评论(0) 推荐(0)

ZOJ 1610 Count the Colors(线段树)
摘要:Count the ColorsTime Limit: 2 Seconds Memory Limit: 65536 KBPainting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your task is counting the segments of different colors you can see at last.InputThe first line of each data set contains . 阅读全文

posted @ 2012-08-10 10:53 kuangbin 阅读(2502) 评论(0) 推荐(0)

ACM POJ 3321 Apple Tree(树状数组)
摘要:Apple TreeTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 11282Accepted: 3214DescriptionThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tree has N f 阅读全文

posted @ 2011-08-16 22:31 kuangbin 阅读(2479) 评论(3) 推荐(1)

ACM HDU 1255 覆盖的面积(矩形面积交,线段树+离散化)
摘要:覆盖的面积Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1415Accepted Submission(s): 677Problem Description给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.Input输入数据的第一行是一个正整数T(1<=T<=100),代表测试数据的数量.每个测试数据的第一行是一个正整数N(1<=N<=1000),代表矩形的数量,然后是N行数据,每一行包含四个浮点数,代表 阅读全文

posted @ 2011-08-16 16:38 kuangbin 阅读(3621) 评论(0) 推荐(0)

ACM POJ1151 (HDU 1542) Atlantis(矩形面积并,线段树+离散化+扫描线)
摘要:AtlantisTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 9693Accepted: 3791DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different 阅读全文

posted @ 2011-08-16 13:57 kuangbin 阅读(4931) 评论(0) 推荐(1)

ACM POJ 2528 Mayor's posters(线段树+离散化)
摘要:题目链接:http://poj.org/problem?id=2528类型:线段树+离散化。本文作者:kuangbin.转载请注明writed by kuangbin (博客www.cnblogs.com/kuangbin)这到题目纠结了我一天,主要是离散化,刚接触线段树不是很熟练。现在对离散化也有... 阅读全文

posted @ 2011-08-15 22:43 kuangbin 阅读(6033) 评论(4) 推荐(3)

ACM HDU 1166 敌兵布阵(简单的线段树)
摘要:敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8754Accepted Submission(s): 3647Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都 阅读全文

posted @ 2011-08-15 20:48 kuangbin 阅读(2145) 评论(1) 推荐(1)

ACM POJ 3468 A Simple Problem with Integers(线段树) by kuangbin
摘要:题目链接:http://poj.org/problem?id=3468本文作者:kuangbin 博客地址:http://www.cnblogs.com/kuangbin/题目:A Simple Problem with IntegersTime Limit: 5000MSMemory Limit:... 阅读全文

posted @ 2011-08-14 20:36 kuangbin 阅读(6142) 评论(0) 推荐(0)

ACM POJ 3264 Balanced Lineup(线段树)
摘要:题目链接:http://poj.org/problem?id=3264作者:kuangbin(转载请注明出处,谢谢!!)更多详细文章,请访问博客:www.cnblogs.com/kuangbinACM POJ 3264 Balanced Lineup这到题目是线段树的练习题目。很简单,练练手!!AC程序:/*POJ 3264 Balanced Lineup题目意思:给定Q(1<=Q<=200000)个数A1,A2,```,AQ,多次求任一区间Ai-Aj中最大数和最小数的差 */#include<stdio.h>#include<algorithm>#incl 阅读全文

posted @ 2011-08-14 13:29 kuangbin 阅读(3258) 评论(0) 推荐(0)

上一页 1 2

导航

JAVASCRIPT: