inline void Prepare(void) { T.clear(); T.n = MAXH; for (int i = 1; i <= m; i++) { rank[i] = make_pair(T.Cal(b[i] - 1) + 1, T.Cal(b[i])); T.Add(b[i], 1); } }
inline pair<int, int> Ask(int a[], int L, int t) { while (last < L) T.Add(a[last++], -1); return make_pair(T.Cal(t - 1) + 1, T.Cal(t)); }