#K69447. Unique Access Report
Unique Access Report
Unique Access Report
You are given a logging system for accessing account IDs. There are n possible distinct account IDs and you are given q queries. Each query is either an access attempt or a request for a report. An access attempt is indicated by a positive integer x ($1 \le x \le n$) which means that account ID x was accessed. A report query is represented by the integer 0. For each report query, you need to output the number of distinct accounts that have been accessed up to that point.
Input Format: The first line contains two space-separated integers n and q. The second line contains q space-separated integers representing the queries.
Output Format: For each report query (i.e., query equal to 0), output the current count of unique accessed accounts on a new line.
Mathematically, if we let \(U\) be the set of all unique account IDs accessed so far, then each report query should output \(|U|\).
inputFormat
The first line contains two integers n and q separated by a space, where n is the number of possible distinct account IDs and q is the number of queries. The second line contains q space-separated integers. Each integer is either a positive integer representing an access attempt for that account ID, or 0 representing a report query.
outputFormat
For each report query, print on a new line the number of unique account IDs that have been accessed so far.
## sample10 3
5 3 0
2
</p>