Binary search - 1
Very easy
Execution time limit is 2 seconds
Runtime memory usage limit is 128 megabytes
A sorted array of integers is given. You need to answer queries: how many times a given number appears in the array.
Input
The first line contains two numbers and . The second line contains integers sorted in increasing order. Each of the following lines contains a single value . All numbers in the array do not exceed in absolute value.
Output
For each value of , print the number of times it occurs in the array in a separate line.
Examples
Input #1
Answer #1
Input #3
Answer #3
Submissions 6K
Acceptance rate 39%