Skip to content

Instantly share code, notes, and snippets.

@diezguerra
Created December 12, 2013 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diezguerra/7931290 to your computer and use it in GitHub Desktop.
Save diezguerra/7931290 to your computer and use it in GitHub Desktop.
In = lambda: map(int, raw_input().split())
integer_no, unique_no = In()
a = In()
uniques = [In().pop() for _ in range(unique_no)]
aux = [0] * integer_no
seen = set()
for idx in xrange(integer_no - 1, -1, -1):
seen.add(a[idx])
aux[idx] = len(seen)
for idx in xrange(unique_no):
print aux[uniques[idx] - 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment