CT375

Draper and the Ember barrels

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Caravans arrive at the mushroom groves of Fungaldeep with crates of barrels, and Draper the accountant must account for every last one. 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 <= 28; -1000000 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 28 -174469 -678817 -371970 -811772 -939686 -173892 -994472 -203751 -402356 -141001 -214430 -329723 -782056 -783869 -821231 -503402 -769182 -191338 -822022 -461406 -9968 -322940 -134613 -422387 -725070 -519210 -893475 -330197
Output: 21

Example 2:

Input: 5 -566366 -941360 -195621 -697983 -443480
Output: 3

Example 3:

Input: 8 -57035 -706266 -419184 -781419 -644720 -580243 -841880 -239651
Output: 1

Constraints:

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

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