Very Simple Question
All submissions for this problem are available.
Chef studies in a good School where programming is taught,
Chef 's Teacher Sameer Srivastava knows that chef knows basic stuffs of programming,to teach him more about programming his teacher gave him a Very Simple Question.
Description of question :
Chef has an array A of N numbers.
His teacher give him two numbers a and b and chef has to find
number of elements in array such that A[i] ≥ a and A[i] ≤ b where 1 ≤ i ≤ n and A[i] denotes the ith element of array.
The first line of input contains a single integer N denoting the number of elements in the array A.
Second Line contains N space separated Integers.
Third line contains Q ,the number of queries.
For each query output a single Integer giving the output of the problem.
- 1 ≤ N, Q ≤ 100000
- 1 ≤ a ≤ b ≤ 109
- 1 ≤ A[i] ≤ 109
Subtask #1 : (30 points)
Subtask #2 : (70 points)
2 5 6 7 1 3 4
|Time Limit:||1 - 1.5 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions