LCC '25 Contest 2 J1 - Duck Duck Duck

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 0.8s
Memory limit: 32M

Author:
Problem type

Duck duck duck duck duck? All ducks have duckness value, indicating their duck superiority over others; the greater the duckness the greater the duck! Given N ducks with distinct duckness values a_i (1 \leq i \leq N), find the index (from 1 to N) of the greatest duck.

Input Specification

The first line of input contains one integer N, the number of ducks.

The second line of input contains N space-separated integers, representing each duck's duckness.

Output Specification

Output one integer, indicating the correct index of the duck with greatest duckness.

Constraints

Subtask 1 [10%]

N = 2

1 \leq a_i \leq 2

Subtask 2 [90%]

1 \leq N \leq 10^5

1 \leq a_i \leq N

Sample Input

5
1 4 5 2 3

Sample Output

3

Sample Explanation

The duck at position 3 is the greatest duck.


Comments

There are no comments at the moment.