eolymp
bolt
Try our new interface for solving problems
Problems

Absolute distinct count

Absolute distinct count

Given a sorted array of integers. Find the number of distinct absolute values among the elements of the array. \InputFile First line contains number of integers $n~(n \le 2 \cdot 10^6)$. Second line contains $n$ integer, sorted in increasing order. Array can contain duplicates values. \OutputFile Print the number of distinct absolute values.
Time limit 1 second
Memory limit 128 MiB
Input example #1
6
-3 -2 0 3 4 5
Output example #1
5
Input example #2
9
-1 -1 -1 -1 0 1 1 1 1
Output example #2
2
Input example #3
4
5 5 5 5
Output example #3
1