#K1201. Find Ride with Maximum Visitors

    ID: 23595 Type: Default 1000ms 256MiB

Find Ride with Maximum Visitors

Find Ride with Maximum Visitors

You are given N, the number of rides, and a list of N integers representing the number of visitors for each ride. Your task is to determine the 1-based index of the ride with the maximum number of visitors. If there are multiple rides with the same maximum number of visitors, return the index of the first occurrence.

The problem can be formulated as follows:

\(\text{Given } N \text{ and an array } visitors = [v_1, v_2, \ldots, v_N], \text{ find the smallest } i \text{ such that } v_i = \max\{v_1, v_2, \ldots, v_N\}.\)

inputFormat

The input is read from standard input (stdin) and consists of two lines:

  • The first line contains an integer N indicating the number of rides.
  • The second line contains N space-separated integers, where the i-th integer represents the number of visitors on the i-th ride.

outputFormat

The output should be written to standard output (stdout) and consist of a single integer: the 1-based index of the ride with the maximum number of visitors.

## sample
5
100 200 200 150 100
2

</p>