B. [R2B]向前看

    Type: Default 1000ms 512MiB

[R2B]向前看

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

时空限制

1S/512M

题目描述

nn 个人排队,从前往后的第 ii 个人身高为 hih_i,求有多少个人满足他前面所有人的高度都低于他。

格式

输入格式

第一行包含一个整数 nn,表示人数。

第二行包含 nn 个整数 h1,h2,...,hnh_1,h_2,...,h_n,分别表示每个人的高度。

输出格式

输出一个整数,表示答案。

样例

样例输入 #1

10
1 2 2 1 4 5 5 7 3 6

样例输出 #1

5

数据规模

对于 60%60\% 的数据, 1n10001\leq n\leq 1000

对于 100%100\% 的数据, 1n2×1051\leq n\leq 2\times 10^51hi1091\leq h_i\leq 10^9

代码源挑战赛 Round 2

Not Attended
Status
Done
Rule
DMY
Problem
6
Start at
2025-3-7 20:00
End at
2025-3-7 21:30
Duration
1.5 hour(s)
Host
Partic.
464