407772: GYM102892 1 Unique Elements
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
1. Unique Elementstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
You have an array of $$$n$$$ integers, and you want to find how many unique elements it has. An element is unique if it only appears once in the array.
For example, the array $$$[5, 7, 8, 5, 4, 4, 3]$$$ contains 3 unique elements: $$$7$$$, $$$8$$$, and $$$3$$$. $$$5$$$ is not a unique element, since it occurs twice in the array.
InputThe first line of input contains a single positive integer $$$n$$$ $$$(1 <= n <= 200000)$$$: the length of the array.
The next line contains $$$n$$$ space-separated integers: the array. The array elements will be between $$$1$$$ and $$$10^9$$$, inclusive.
OutputOutput a single positive integer: the number of unique elements in the array.
ScoringFull problem: 5 points
ExamplesInput9 1 2 3 4 2 5 1 6 7Output
5Input
8 1 3 3 2 3 1 2 1Output
0Input
7 6 5 7 3 4 1 2Output
7