SOLVE

LATER

Confusion

Problem

Editorial

Analytics

As you know our star "gachn" is rising star in competitive programming but now a days he is upset because of a task given to him by his mentor.
His teacher gave him a task :
The task is that he has been given a array of **N** integers . his teacher gave him **Q** queries to solve.For each query he has to tell the teacher the number of distinct integers from **A _{i}.A_{i+1}.A_{i+2}.......A_{N}.**

For example **N=5 and Q=3**.

**Input**

5 3

1 2 3 2 1

2

1

4

**Output :**

3

3

2

**Constraints :**

**1<=N,Q<=100000**

**1<=A[i]<=100000**

**1<=l<=N**

**Input**

First line will contain 2 integers **N ,Q**.
next line will contain **N-space** separated integers.
next **Q** lines will contain an integer** L**

**Output**

For each **Q** lines output the no.of distinct integers.

Time Limit:
0.2 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

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

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

Initializing Code Editor...

{"5b045e8": "/pagelets/problems-hint/algorithm/confusion-1/", "5b0460f": "/pagelets/recommended-problems/algorithm/confusion-1/", "5b04566": "/pagelets/show-submission/algorithm/confusion-1/", "5b04598": "/pagelets/suggested-problems/algorithm/confusion-1/", "5b045c1": "/pagelets/problem-author-tester/algorithm/confusion-1/"}

{}

realtime.hackerearth.com

80

4d31c08d532a445c0d27bb04d72a1abf5b9c73bc

58a29e5cae2309f04b28

/realtime/pusher/auth/