随笔分类 -  数据结构-线段树

摘要:题目连接http://poj.org/problem?id=2777Count ColorDescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all... 阅读全文
posted @ 2015-10-10 16:11 GadyPu 阅读(158) 评论(0) 推荐(0)
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3530SubsequenceDescriptionThere is a sequence of integers. Your task is to find the longest subsequence ... 阅读全文
posted @ 2015-06-22 21:05 GadyPu 阅读(181) 评论(0) 推荐(0)
摘要:题目连接http://poj.org/problem?id=2299Ultra-QuickSortDescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm process... 阅读全文
posted @ 2015-06-12 19:57 GadyPu 阅读(189) 评论(0) 推荐(0)
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1556Color the ballDescription$N$个气球排成一排,从左到右依次编号为$1,2,3....N.$每次给定2个整数$a\ b(a \leq b)$,lele便为骑上他的“小飞鸽"牌电... 阅读全文
posted @ 2015-06-10 20:29 GadyPu 阅读(149) 评论(0) 推荐(0)
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=1698Just a HookDescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for... 阅读全文
posted @ 2015-06-03 22:38 GadyPu 阅读(159) 评论(0) 推荐(0)
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=4027Can you answer these queries?DescriptionProblem DescriptionA lot of battleships of evil are arranged... 阅读全文
posted @ 2015-05-29 22:51 GadyPu 阅读(170) 评论(0) 推荐(0)
摘要:题目连接http://poj.org/problem?id=2823Sliding WindowDescriptionAn array of sizen≤ 106is given to you. There is a sliding window of sizekwhich is moving fr... 阅读全文
posted @ 2015-05-29 20:24 GadyPu 阅读(208) 评论(0) 推荐(0)
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3074Minimum Inversion NumberDescriptionTired of playing computer games, alpc23 is planning to play a gam... 阅读全文
posted @ 2015-05-29 17:09 GadyPu 阅读(128) 评论(0) 推荐(0)
摘要:原题链接:http://ac.jobdu.com/problem.php?pid=1407线段树,区间更新,查询区间最小值。注意区间更新,查询的时候,区间$\begin{align*}[L,R] \end{align*}$$\begin{align*}L \end{align*}$都可能大于$\be... 阅读全文
posted @ 2015-05-27 14:56 GadyPu 阅读(256) 评论(0) 推荐(0)
摘要:原题链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1798线段树区间更新: 1. 区间同同时加上一个数 2. 区间同时乘以一个数 1 #include 2 #include 3 #include 4 #include 5 #define lc ... 阅读全文
posted @ 2015-05-25 21:26 GadyPu 阅读(152) 评论(0) 推荐(0)
摘要:原题链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1012线段树,单点更新。。 1 #include 2 #include 3 #include 4 #include 5 #define lc root r || pos = r) {20 ... 阅读全文
posted @ 2015-05-24 21:53 GadyPu 阅读(135) 评论(0) 推荐(0)
摘要:原题链接:http://ac.jobdu.com/problem.php?pid=1544RMQ线段树。。。如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using std::min; 7 const int Max_N =... 阅读全文
posted @ 2015-05-04 21:43 GadyPu 阅读(194) 评论(0) 推荐(0)