CT1382

The Greyfen First Peak Index

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Scribe runs the fish market at the foggy moor of Greyfen. Today the books show a list of lanterns, and the numbers must be worked out before sundown. 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 <= 54; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 28 -387151 -325422 -727786 -626378 -453614 -422672 -320404 -438029 -88768 -596321 -732084 -312342 -188673 -852710 -186298 -682021 -725874 -374776 -201227 -821694 -656567 -728295 -655241 -502557 -198757 -616232 -764702 -699276
Output: 9

Example 2:

Input: 13 -811806 -374368 -373583 -114628 -935047 -832520 -182836 -833536 -62671 -707516 -110252 -646196 -890560
Output: 9

Example 3:

Input: 48 -256326 -84281 -286105 -172601 -436682 -397758 -554604 -676590 -401722 -846961 -403505 -642230 -12127 -3468 -649048 -849886 -558879 -938797 -658359 -919875 -997301 -363643 -551020 -574069 -155973 -187041 -408704 -254802 -950170 -331568 -355277 -412806 -11338 -378764 -112460 -95881 -976712 -156243 -70785 -732364 -6040 -316674 -481842 -74715 -701190 -286137 -940063 -341391
Output: 14

Constraints:

1 <= n <= 54; -1000000 <= a[i] <= 10; answers fit a signed 64-bit integer.

Loading...
Test Cases:No test cases
No test cases available.