You are given an integer N on the first line, and N integers separated by single spaces on the second line. Output, on one line, the position at which the largest value appears, counting the first element as position 1.
If there are multiple occurrences of the maximum value, answer with the position of the earliest one.
Constraints
1 ≤ N ≤ 100, 0 ≤ each element ≤ 1000
Input example 1
5
3 1 4 1 5Output example 1
5Input example 2
3
10 2 7Output example 2
1What you'll train
Cover the edge cases
What you get
How to ask the AI
Clearly convey which one to answer with when there are multiple occurrences of the maximum value (the earliest one), and specify that positions are counted starting from 1.
If you ask vaguelyIf there are multiple occurrences of the maximum value, the AI might answer with the index of the last one found.
あなたのコード
プレビュー
AIレビュー(プロンプト練習)
コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。