CT24347

The First Peak Index of the Copper stamps

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The council of the tannery row of Leatherwick pays by the answer, and Wasim intends to earn it. First: the full register of stamps. 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 <= 782; -100 <= a[i] <= 10; answers fit a signed 64-bit integer.

Example 1:

Input: 600 -79 -51 -93 5 -62 -67 -76 -3 -90 -69 -27 -76 -21 -59 -61 -45 -100 -90 -85 -49 10 0 -57 -22 -67 -14 -89 -70 -23 -19 3 -39 -94 -66 3 -22 -59 -79 -20 -31 -55 -13 -9 -24 10 -11 -22 7 -65 -91 -41 7 -9 -28 -32 -71 -96 -14 -40 -76 -21 -19 -78 -81 -9 -62 -100 7 -88 -65 -86 8 -60 3 -22 3 -78 -87 -100 2 -30 -61 5 2 1 -99 -85 -51 -75 -7 -17 -8 -10 -13 -6 -65 -53 -72 -44 -88 -87 -15 -27 -2 -16 -40 -38 -19 -13 -17 -76 3 -10 -29 -42 -17 -46 -3 -75 -2 -31 -67 -79 -16 -7 -41 -32 -69 -14 -1 -16 -60 -42 -70 -57 -71 1 -99 6 -51 -68 9 -35 -64 -34 -39 -71 5 -58 -89 -55 -96 -20 -19 -31 -19 -97 -76 -78 -31 -79 -99 -1 -89 -51 -56 7 -20 -76 -97 -21 -37 -89 -19 -27 -26 -40 -48 -33 -7 -73 -76 -99 -76 -85 -45 5 -99 -10 -16 -98 -56 -35 -30 -40 -29 -52 -67 -40 -82 -52 -62 -83 -12 -11 -100 -66 -22 -55 -54 -87 -39 -7 -93 -63 -55 -97 -80 -55 -14 -76 -6 -70 -76 -72 -42 -61 -17 -56 -71 -44 9 7 -32 -53 -40 -1 -37 -42 -10 10 -30 -85 -50 -63 -86 -18 -90 -14 -92 -34 -51 -74 -74 -12 7 -89 -11 -29 -98 -12 -64 -28 -35 -54 -87 -68 -98 -80 -89 -8 -61 -95 -8 -28 -61 -81 -97 -100 -9 -94 8 -11 -21 -74 -69 -99 -50 -57 -5 -93 -31 -3 -30 -73 -55 -72 -59 -14 -26 -3 -29 -1 -83 -51 -41 -75 -48 -18 -4 -30 -62 -45 -8 -59 -7 -86 -49 10 8 -93 -28 9 -50 -69 -84 -99 -99 -72 -10 -49 -90 -22 -67 -37 -25 -74 -71 8 -35 -63 -65 -30 -27 -63 -33 -37 -31 -23 -90 -56 -18 4 -96 -57 -40 -11 -22 -33 2 -95 -63 10 -48 -68 -66 -21 -83 -31 -97 -85 -18 -71 -95 -42 -47 -39 -37 -84 -12 -39 -96 -38 -13 -92 -37 -25 7 -50 -14 -18 -49 -49 -85 -87 -56 -58 -83 -6 -46 -4 -32 7 -67 -14 -38 -29 -84 6 -89 7 -92 -54 -8 -90 -21 -92 -82 -53 -47 3 -72 -66 -92 -25 -30 -28 -96 -43 -91 -37 -80 -55 -98 -34 -53 -6 -45 6 -18 -78 -40 -14 -69 -5 -45 -20 -28 -32 -63 -62 -91 -43 -12 -26 -34 -74 -78 -6 -47 -8 -47 -35 -97 -33 -62 -34 -27 -100 4 -65 0 0 9 -23 -19 -63 -87 -89 -70 -55 -57 -75 -18 3 -31 -78 -97 -90 -60 -73 -32 -45 -62 -15 -64 -20 -42 -58 -31 -85 -32 -83 -89 -22 -32 -27 -76 -14 -79 -56 -47 -22 -75 -54 3 -68 -72 -31 -93 -40 2 -48 -1 -39 -53 -55 -45 -5 -48 -86 -33 9 -77 -75 -39 -85 -9 -25 -21 8 -22 -28 2 -81 -87 -54 -2 1 -56 -91 -6 -19 -12 -49 -42 -87 -63 -63 -80 -6 -78 -81 -80 0 -1 -71 -23 -23 -95 1 -53 -77 -85 -58 -43 -78 -69 -68 -97 -6 1 -86 -24 -59 -9 -47 -34 -24 -35 -37 -40 -88 -97 -31 -14 -29 10 -91 -51
Output: 21

Example 2:

Input: 29 -36 -72 -44 -40 -40 -5 -68 -6 -44 -77 -14 -77 -82 -26 -62 -38 -90 -41 -3 -77 -64 -64 5 8 -40 -14 -80 -4 9
Output: 29

Example 3:

Input: 43 10 -22 1 -71 -26 4 -75 -47 -49 -9 -40 -4 -98 -7 -30 5 -55 -64 -18 -89 -69 -40 -67 -95 -84 -64 -9 -20 -9 -63 -54 -70 -53 -85 -45 -86 -52 -15 -74 -62 -30 -23 -15
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The First Peak Index of the Copper stamps - EASY Coding Problem | CodeTikki