CT930

Last coins of Lamplighter

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The harbor bell rings at the river town of Willowford; Lamplighter weighs the day's coins manifests and starts the calculations. 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 <= 69; -1000000 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 64 -165746 998860 900106 -685152 -398134 669569 316752 -381105 77219 -555770 -603954 -230921 -575850 -182325 242783 390095 -797510 -960530 -540652 -868113 -15328 -984945 -646112 769047 79802 -452732 -235012 -355283 919637 -586568 449248 907112 -475604 -775753 -65431 247977 -146371 181091 -537358 950287 -695449 326427 -863942 -156525 -502357 -261749 -992312 21757 872975 -521439 564338 55340 50201 -935427 -218592 211417 927562 689806 -892983 -864181 -11057 878529 554103 -471941
Output: 2

Example 2:

Input: 34 865065 -536896 234479 851908 898021 -491659 -939220 -142015 -499314 -741616 402071 690152 966979 -844154 -770336 90803 931369 273447 -586319 592341 831512 -631253 316908 -930111 -759336 568295 -44176 -279604 782529 611564 992916 595434 -258176 -164898
Output: 31

Example 3:

Input: 11 877255 856505 -550030 587607 -264679 -358795 -312263 558151 -21920 472852 -950641
Output: 1

Constraints:

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

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