Problem list
Log in
#r03246 · Online Judge > GoldOJ

Visible Sticks

Bronze II 2.0 s 1024 MB

$n$ sticks stand in a row. Looking from the right, a stick is visible only if every stick to its right is strictly shorter. Print how many sticks are visible.

Input

Line 1: $n$ ($1 \le n \le 100000$). Line 2: $n$ heights in $[1, 100000]$.

Output

Print the number of visible sticks.

Example 1

Input
6
6 9 7 6 4 6
Output
3
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code