SOLVE

LATER

Memorise Me!

Problem

Editorial

Analytics

Arijit is a brilliant boy. He likes memory games. He likes to participate alone but this time he has to have a partner. So he chooses **you**.

In this Game , your team will be shown ** N** numbers for few minutes . You will have to memorize these numbers.

Now, the questioner will ask you ** Q queries**, in each query He will give you a number , and you have to tell him

**INPUT And OUTPUT**

The first line of input will contain N, an integer, which is the total number of numbers shown to your team.

The second line of input contains N space separated integers .

The third line of input contains an integer Q , denoting the total number of integers.

The Next Q lines will contain an integer denoting an integer, \(B_i\) , for which you have to print the number of occurrences of that number (\(B_i\)) in those N numbers on a new line.

If the number \(B_i\) isn’t present then Print “NOT PRESENT” (without quotes) on a new line.

**CONSTRAINTS**

\(1 \le N \le 10^{5} \)

\(0 \le B_i \le 1000\)

\(1\le Q \le 10^{5}\)

Explanation

The given array is (1,1,1,2,2,0) of size 6.

Total number of queries is 6 also.

For the first query i.e for 1 , the total of number of occurrences of 1 in the given array is 3 . Hence the corresponding output is 3.

For the second query i.e. for 2, the total of number of occurrences of 2 in the given array is 2 . Hence the corresponding output is 2.

For the fifth query i.e. for 3. 3 is not present in the array . So the corresponding output is "NOT PRESENT" (without quotes).

Time Limit:
0.6 sec(s)
for all input files combined.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
Bash,
C,
C++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Kotlin,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Swift-4.1,
TypeScript,
Visual Basic

Initializing Code Editor...

{"c5fb6a1": "/pagelets/recommended-problems/algorithm/memorise-me/", "4721201": "/pagelets/show-submission/algorithm/memorise-me/", "8861eb8": "/pagelets/problem-author-tester/algorithm/memorise-me/", "7c3ee76": "/pagelets/problems-hint/algorithm/memorise-me/"}

realtime.hackerearth.com

80

e33d3346f9982f85d6fcc921901a65884354f049

58a29e5cae2309f04b28

/realtime/pusher/auth/