5004. Count 1
时间限制:1000 MS 内存限制:256 MB
题目描述
## 题目描述 For a given sequence of integers A={a0,a1,...,an-1}A={a0,a1,...,an-1}, perform the following operations. - count(b,e,kb,e,k): print the number of the specific values kk in ab,ab+1,...,ae-1ab,ab+1,...,ae-1. ## 输入格式 The input is given in the following format. ``` nn a0a1,...,an−1a0a1,...,an−1 qq b1e1k1b1e1k1 b2e2k2b2e2k2 : bqeqkqbqeqkq ``` The number of elements nn and each element aiai are given in the first line and the second line respectively. In the third line, the number of queries qq is given and the following qq lines, qq integers bibekibibeki are given as queries. ## 输出格式 For each query, print the number of specified values. ## 数据范围 - 1\len\le1,0001\len\le1,000 - -1,000,000,000\leai,ki\le1,000,000,000-1,000,000,000\leai,ki\le1,000,000,000 - 1\leq\le1,0001\leq\le1,000 - 0\leb<e\len0\leb<e\len ## 输入 ```in1 9 1 4 1 4 2 1 3 5 6 3 0 9 1 1 6 1 3 7 5 ``` ## 输出 ```out1 3 2 0 ```