#P10814. 【模板】离线二维数点
【模板】离线二维数点
Background
Frogs.
Problem Description
You are given a sequence of length . There are queries. Each query gives . Find the number of elements in the interval that are less than or equal to .
Input Format
The first line contains two integers .
The second line contains integers representing the sequence .
The following lines each contain three integers , representing one query.
Output Format
For each query, output one line with one integer, the answer.
6 4
1 1 4 5 1 4
1 6 3
1 6 4
1 1 4
1 5 4
3
5
1
4
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5