#C11442. Sum of Unique Integers
Sum of Unique Integers
Sum of Unique Integers
You are given a list of integers. Your task is to compute the sum of all unique integers in the list. That is, each distinct integer contributes only once to the sum.
In mathematical notation, if \( U \) is the set of unique integers in the list, then the answer is given by:
\( S = \sum_{x \in U} x \)
If the list is empty, output 0.
inputFormat
The input is given via standard input (stdin) and consists of two lines:
- The first line contains a single integer \( n \), the number of elements in the list.
- The second line contains \( n \) space-separated integers.
If \( n = 0 \), the list is empty.
outputFormat
Output a single integer representing the sum of all unique integers in the list. The output should be written to standard output (stdout).
## sample6
1 2 2 3 3 3
6