atcoder#AGC029C. [AGC029C] Lexicographic constraints
[AGC029C] Lexicographic constraints
Score : points
Problem Statement
There are strings arranged in a row. It is known that, for any two adjacent strings, the string to the left is lexicographically smaller than the string to the right. That is, S_ii$-th string from the left.
At least how many different characters are contained in , if the length of is known to be ?
Constraints
- is an integer.
Note
The strings do not necessarily consist of English alphabet; there can be arbitrarily many different characters (and the lexicographic order is defined for those characters).
Input
Input is given from Standard Input in the following format:
Output
Print the minimum possible number of different characters contained in the strings.
3
3 2 1
2
The number of different characters contained in would be when, for example, abc
, bb
and c
.
However, if we choose the strings properly, the number of different characters can be .
5
2 3 2 1 2
2