#abc372d. D - Buildings
D - Buildings
Score : points
问题陈述
有 座建筑物,按照顺序排列为建筑物 ,建筑物 ,,建筑物 。建筑物 的高度为 。
对于每个 ,找出满足以下条件的整数 的数量:
- 在建筑物 和建筑物 之间没有比建筑物 更高的建筑物。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
There are buildings, Building , Building , , Building , arranged in a line in this order. The height of Building is .
For each , find the number of integers satisfying the following condition:
- There is no building taller than Building between Buildings and .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
For each , let be the number of satisfying the condition. Print in order, separated by spaces.
Sample Input 1
5
2 1 4 3 5
Sample Output 1
3 2 2 1 0
For , the integers satisfying the condition are , , and : there are three. (Between Buildings and , there is a building taller than Building , which is Building , so does not satisfy the condition.) Therefore, the first number in the output is .
Sample Input 2
4
1 2 3 4
Sample Output 2
3 2 1 0
Sample Input 3
10
1 9 6 5 2 7 10 4 8 3
Sample Output 3
2 3 3 3 2 1 2 1 1 0