#P10288. [GESP样题 八级] 区间
[GESP样题 八级] 区间
Background
Related multiple-choice and true/false problems: https://ti.luogu.com.cn/problemset/1108.
Problem Description
Xiao Yang has a positive integer sequence of length .
Xiao Yang has queries. In the -th query (), Xiao Yang gives . Please find how many times appears in .
Input Format
The first line contains a positive integer , indicating the number of test cases.
For each test case: the first line contains a positive integer , indicating the length of sequence .
The second line contains positive integers , representing the sequence .
The third line contains a positive integer , indicating the number of queries. The next lines each contain three positive integers , representing one query.
Output Format
For each test case, output lines. On the -th line (), output a non-negative integer representing the answer to the -th query.
2
5
7 4 6 1 1
2
1 2 3
1 5 1
5
1 2 3 4 5
2
5 5 3
1 4 3
0
2
0
1
Hint
Constraints
| Subtask | Points | |||
|---|---|---|---|---|
For all testdata, it is guaranteed that , , and .
Translated by ChatGPT 5