#CCBCHBAHAI0000162. Chỉ số max đầu tiên (First Maximum Index)
Chỉ số max đầu tiên (First Maximum Index)
First 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
Thus, ties for the maximum must be resolved by choosing its first 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
1
Explanation
The maximum occurs at indices ; the first is .