CT2068

Owen and the First Peak Index

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The factor Owen has been asked to verify the safety inspections. On the desk lies a long table of readings readings. Task: Read n integers and print the 1-based index of the first occurrence of the maximum value. Input format: First line: n. Second line: n space-separated integers. Output format: Print the 1-based index of the first maximum. Constraints: 1 <= n <= 38; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 7 3383552 277559332 703453660 112592503 733490834 493805265 627937648
Output: 5

Example 2:

Input: 27 330610760 995730122 841637702 608631499 198530649 692436583 354492484 202931485 264512229 1294428 751337368 178522842 948312322 614376092 823198251 341572293 753196342 892060774 253823924 666997021 668470674 52627559 21592496 220365200 737694150 311323986 719360922
Output: 2

Example 3:

Input: 7 293382684 554562475 425920906 239888664 948886494 525570721 154542592
Output: 5

Constraints:

1 <= n <= 38; -100 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.
Owen and the First Peak Index - EASY Coding Problem | CodeTikki