CT883

The Rustic tickets of Warden

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Morning light hits the wren hedges of Thimblewick as Warden unrolls the day's manifest of tickets. The tally will decide the next shipment. 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 <= 86; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 72 -92 -92 -52 -66 -100 8 -5 -9 -2 -46 -58 -3 -89 -44 -55 -79 -92 -38 -29 -2 -18 -26 -6 -16 -26 -48 -96 0 -77 -15 -25 -48 -72 -97 -10 -92 -30 -74 -30 9 5 -4 -98 -59 -41 -37 -53 -26 -67 -36 2 -88 -53 -55 -73 -36 -4 -27 -55 -95 -21 7 -93 -60 -19 9 -48 -49 -82 -15 -46 -32
Output: 40

Example 2:

Input: 54 -75 -97 -60 -44 -52 -67 -91 -37 -33 -17 -37 -51 -89 -26 -94 -70 -88 6 -68 -50 -25 -41 -1 -23 -80 -56 -98 -86 -68 5 -39 -1 -80 -5 -81 -17 -20 -96 -22 -34 -80 -87 -41 -15 -28 -59 -85 -49 -89 -32 -51 -96 -30 -89
Output: 18

Example 3:

Input: 75 -97 -46 -40 -61 -65 -12 -53 -27 -11 -9 -95 -11 -97 -25 -71 -13 -17 -42 2 -80 -57 -54 -57 -50 -25 5 -68 -37 -34 -51 -86 -62 -26 3 -4 -52 -78 -64 -6 -35 -76 -64 -4 -60 -27 -7 0 -88 2 -25 -14 -3 -46 0 -42 -80 -79 -19 -20 -80 -60 10 -90 -1 -18 -33 5 -21 -82 -29 -46 -76 2 -50 -7
Output: 62

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Rustic tickets of Warden - EASY Coding Problem | CodeTikki