Dominant element - MarisaOJ: Marisa Online Judge

Dominant element

Time limit: 1000 ms
Memory limit: 256 MB
Given an array $A$ of $n$ integer elements, count the number of dominant elements in the array. An element is considered dominant if it is greater than all the elements to its right in the array. The last element cannot not be a dominant element as there is no element to its right in the array. ### Input - The first line contains an integer $n$. - The second line contains $n$ integers $A_i$. ### Output - Print the count of dominant elements in the array. ### Constraints - $1 \le n \le 100$ - $1 \le A_i \le 100$. ### Sample test ``` 5 4 3 2 5 1 ``` Output: ``` 1 ```