
RMQ-ST算法
文章平均质量分 87
RJ28
小学生
展开
-
Hdu-5289 Assignment (二分+RMQ || 单调队列)
Problem Description Tom owns a company and he is the boss. There are n staffs which are numbered from 1 to n in this company, and every staff has a ability. Now, Tom is going to assign a special task原创 2016-05-29 10:51:49 · 388 阅读 · 0 评论 -
Codeforces Round #353 (Div. 2) E. Trains and Statistic
Vasya commutes by train every day. There are n train stations in the city, and at the i-th station it's possible to buy only tickets to stations from i + 1 to ai inclusive. No tickets are sold at th原创 2016-05-31 16:02:11 · 489 阅读 · 0 评论 -
Codeforces Round #361 (Div. 2) D. Friends and Subsequences (二分+RMQ)
Mike and !Mike are old childhood rivals, they are opposite in everything they do, except programming. Today they have a problem they cannot solve on their own, but together (with you) — who knows?原创 2016-07-18 22:27:51 · 597 阅读 · 0 评论 -
Hdu-5726 GCD (二分 + RMQ)
Problem Description Give you a sequence of N(N≤100,000) integers : a1,...,an(0ai≤1000,000,000). There are Q(Q≤100,000) queries. For each query l,r you have to calculate gcd(al,,al+1,...,ar)原创 2016-07-20 21:33:48 · 672 阅读 · 0 评论 -
Hdu-5875 Function(树上倍增st算法)
Problem Description The shorter, the simpler. With this problem, you should be convinced of this truth. You are given an array A of N postive integers, and M queries in the form (l,r).原创 2016-09-10 20:14:21 · 655 阅读 · 0 评论 -
CodeForces - 842C Ilya And The Tree(树上倍增)
Ilya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very interesting tree rooted at vertex 1. There is an integer number written on each vertex of the tree;原创 2017-09-15 16:14:14 · 339 阅读 · 0 评论