100 atcoder#ABC134E. [ABC134E] Sequence Decomposing
[ABC134E] Sequence Decomposing
Score : points
Problem Statement
You are given a sequence with integers: . For each of these integers, we will choose a color and paint the integer with that color. Here the following condition must be satisfied:
- If and are painted with the same color, .
Find the minimum number of colors required to satisfy the condition.
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the minimum number of colors required to satisfy the condition.
5
2
1
4
5
3
2
We can satisfy the condition with two colors by, for example, painting and red and painting , , and blue.
4
0
0
0
0
4
We have to paint all the integers with distinct colors.