/
実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 233 点
問題文
高橋君は焼き肉屋で N 枚の肉を同時に網に乗せました。 i 枚目の肉は、乗せてから A_i 秒後に焼き上がります。
最初に焼き上がる肉は何枚目かを求めてください。最初に焼き上がる肉が複数ある場合は、そのうち番号が最も小さいものを答えてください。
制約
- 1 \leq N \leq 100
- 1 \leq A_i \leq 1000
- 入力はすべて整数
入力
入力は以下の形式で標準入力から与えられる。
N A_1 A_2 \ldots A_N
- 1 行目には、肉の枚数 N が与えられる。
- 2 行目には、各肉が焼き上がるまでの秒数 A_1, A_2, \ldots, A_N がスペース区切りで与えられる。
出力
最初に焼き上がる肉の番号を 1 行で出力せよ。複数ある場合は最も小さい番号を出力せよ。
入力例 1
4 30 10 20 40
出力例 1
2
入力例 2
1 5
出力例 2
1
入力例 3
3 9 8 7
出力例 3
3
入力例 4
7 130 623 701 180 63 216 91
出力例 4
5
入力例 5
8 361 505 856 200 271 262 190 149
出力例 5
8
Score : 233 pts
Problem Statement
Takahashi placed N pieces of meat on the grill at a yakiniku restaurant at the same time. The i-th piece of meat will finish cooking A_i seconds after being placed on the grill.
Find which piece of meat finishes cooking first. If multiple pieces finish first, answer the one with the smallest index.
Constraints
- 1 \leq N \leq 100
- 1 \leq A_i \leq 1000
- All input values are integers.
Input
The input is given from standard input in the following format:
N A_1 A_2 \ldots A_N
- The first line contains the number of pieces of meat N.
- The second line contains the numbers of seconds A_1, A_2, \ldots, A_N until each piece finishes cooking, separated by spaces.
Output
Print the index of the piece of meat that finishes cooking first in one line. If there are multiple such pieces, print the smallest index.
Sample Input 1
4 30 10 20 40
Sample Output 1
2
Sample Input 2
1 5
Sample Output 2
1
Sample Input 3
3 9 8 7
Sample Output 3
3
Sample Input 4
7 130 623 701 180 63 216 91
Sample Output 4
5
Sample Input 5
8 361 505 856 200 271 262 190 149
Sample Output 5
8