提交链接:CF 689D
题面:
D. Friends and Subsequences
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
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?
Every one of them has an integer sequences a andb of length n. Being given a query of the form of pair of integers(l, r), Mike can instantly tell the value of

本文介绍了如何利用RMQ(Range Minimum Query)和二分查找法解决CodeForces上的一道题目,该题目要求找出两个等长序列中,最大值等于最小值的子序列数量。通过RMQ预处理和二分查找优化,实现了O(n log n)的时间复杂度解决方案。
228

被折叠的 条评论
为什么被折叠?



