CT22890

Ishaan's Dusky ingots

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the honeycomb cliffs of Beeswick; Ishaan weighs the day's ingots 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 <= 252; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 120 274127759 982525400 516138325 669632879 481406715 168586672 893376056 65880957 318461994 629127929 961422237 958486467 845825084 706118633 640047238 797121444 994910960 796578339 339125858 779376834 993623737 214338466 66919460 323375732 518370978 176125036 152151363 -106874 483521753 94599934 672242912 12964730 801249527 175264552 983676436 147852681 677880382 586092747 436758712 355402024 7489165 747483811 762353279 951741547 556334570 113443983 229690478 163182185 843710858 822512033 696642536 267239474 548266908 867820489 648564467 495787442 554659857 808539768 33142945 802011909 404961091 240084276 434278106 114756626 463244650 622356779 842087285 898714188 663180595 615596271 684423809 151008115 231061647 695049552 831609882 64012461 403074670 763104346 755299139 387809635 492508…
Output: 92

Example 2:

Input: 71 968448408 956779650 397712746 325543765 438635396 732828459 127991868 577340121 968622625 307891231 233793504 662119025 951036011 27359663 559745721 63990190 998135792 970782086 998249332 466811238 506951569 35157162 432093014 212330286 443489134 567796107 655208012 803199016 380658061 313081174 819648981 275516325 719516884 988130858 826627429 651667287 985961978 266771138 528446095 392740997 247787776 158496160 924232964 599242950 963288758 381661753 181266553 459135886 721176461 893063049 792777577 581449424 332427222 171545599 899240553 951667272 944429937 761273601 924995195 731211779 619560975 930455033 598731182 630128721 805277366 214445003 260831873 972189597 768721886 534231874 82314235
Output: 19

Example 3:

Input: 218 979305256 678093566 248321531 714760976 708498442 45925822 884049623 343625368 164664939 681435968 779563677 141114684 175419686 291509704 942652627 110995173 600232547 810867017 35918605 138145062 773918614 750586230 271888631 381192247 647666230 906234334 700502162 14997860 271056961 514799003 722255826 870221140 535154960 367099300 104156478 266944591 856975150 669598722 490488056 914777829 481575544 735595294 401952076 738986375 109808817 944412451 633673469 530072442 74829338 6616157 747957355 348785532 724935465 62379485 299078759 49109518 414735788 614960433 931138960 148455560 685145920 564730641 581037009 315444300 429595095 429222518 185115397 516374208 949459069 5077087 46557714 801607307 269746191 107018229 304252985 878087722 229778912 160749221 380575624 377752109 3122951…
Output: 127

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Ishaan's Dusky ingots - EASY Coding Problem | CodeTikki