#CCBCHBAHAI0000163. Chỉ số max cuối cùng (Last Maximum Index)
Chỉ số max cuối cùng (Last Maximum Index)
Last Maximum Index
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem
Given an integer array of length , indexed from to . Let . Find
Ties must be resolved by choosing the last occurrence.
Input
- Line 1: integer .
- Line 2: integers .
Output
Print the 0-based index .
Subtask
Subtask 1 (100 points): ; .
Example
Input
7
3 9 4 9 2 9 1
Output
5
Explanation
The maximum occurs at indices ; the last is .