HBC51119小H的数列,数学,高精度K-th Number题解

你曾走过我的故事 算法基础篇 101 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。
You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able to return quickly k-th order statistics in the array segment.That is, given an array a[1...n] of different integer numbers, your program must answer a series of questions Q in the form: "What would be the k-th number in a[i...j] segment, if this segment was sorted?For example, consider the array a = . Let the question be Q. The segment a[2...5] is . If we sort this segment, we get , the third number is 5, and therefore the answer to the question is 5.

You are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure that would be able to return quickly k-th order statistics in the array segment.  That is, given an array a[1...n] of different integer numbers, your program must answer a series of questions Q(i, j, k) in the form: "What would be the k-th number in a[i...j] segment, if this segment was sorted?"  For example, consider the array a = (1, 5, 2, 6, 3, 7, 4). Let the question be Q(2, 5, 3). The segment a[2...5] is (5, 2, 6, 3). If we sort this segment, we get (2, 3, 5, 6), the third number is 5, and therefore the answer to the question is 5.

HBC51119小H的数列,数学,高精度K-th Number题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
成为编程大师,不再是梦想!全网最全C++题库,助您开启编程新篇章。

标签: HBC51119小H的数列 数学 高精度K-th Number题解