K-th Closest Distance Time Limit: 20000/15000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1697 Accepted Submission(s): 633 Problem Description You have an array: a1, a2, , an and you must answer for some qu…
题意:给定一个长为n的序列,有m次强制在线的询问,每次询问位置[L,R]中abs(a[i]-p)第k小的值 n,m<=1e5,a[i]<=1e6,p<=1e6,k<=169 思路:主席树外面套个二分 #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; typedef pai…