# Range Kth Smallest

AC一覧

## Problem Statement / 問題文

You are given an integer sequence $a_0, a_1, ..., a_{N-1}$ with the length $N$. Process the following $Q$ queries in order:

• $l_i$ $r_i$ $k_i$: Print $k_i+1$ th smallest value in $(a_{l_i}, a_{l_i + 1}, ..., a_{r_i - 1})$.

## Problem Statement (Japanese) / 問題文 (日本語)

• $l_i$ $r_i$ $k_i$: $(a_{l_i}, a_{l_i + 1}, ..., a_{r_i - 1})$ のうち $k_i+1$ 番目に小さい値を出力する。

## Constraints / 制約

• $1 \leq N \leq 200{,}000$
• $1 \leq Q \leq 200{,}000$
• $0 \leq a_i \leq 10^{9}$
• $0 \leq l_i < r_i \leq N$
• $0 \leq k_i < r_i - l_i$

## Input / 入力

$N$ $Q$
$a_0$ $a_1$ ... $a_{N - 1}$
$l_0$ $r_0$ $k_0$
$l_1$ $r_1$ $k_1$
:
$l_{Q-1}$ $r_{Q-1}$ $k_{Q-1}$


### # 1

5 3
1 4 0 1 3
0 5 2
1 3 1
3 4 0

1
4
1


Timelimit: 5 secs