CT25791

The First Peak Index Beneath Driftwood

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Koda inherited the aviary at the quays of Driftwood along with its curious bookkeeping system for parcels. Time to make sense of it. 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 <= 374; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 257 412755 466559 459164 424505 760385 638291 38083 502366 867115 142076 628096 988522 429756 569279 468400 823273 385124 768128 310241 614720 857271 991335 603508 719273 919883 644279 265938 37908 884425 914423 909476 986306 681879 872576 450724 927474 124456 54423 424130 651864 397243 543173 736963 649333 355816 472771 691076 297533 818193 690713 616514 590537 388877 172931 295805 286369 117365 871403 862922 171488 901338 461380 28509 294279 920603 418113 718222 927791 390348 604915 229214 807864 438776 588031 185198 136851 504207 526158 798633 876581 847921 734079 402355 551059 515163 418048 572413 811562 573350 846168 99742 967557 936754 933647 996214 325357 541181 478245 83154 696954 726770 978935 233882 130155 724826 755557 178128 331850 714742 391126 552510 801132 840002 353208 7061…
Output: 194

Example 2:

Input: 58 4865 339504 809651 805443 125837 134612 731045 522207 920418 802074 442429 663820 494804 168103 866483 11327 639604 380784 144600 195749 220591 281213 178112 702146 683978 671942 492742 492764 518459 895489 751275 787926 66111 780404 87743 145583 197046 779295 505980 359612 286168 538236 491515 999228 902772 957812 639878 337631 223669 721841 123120 950392 864944 15262 151483 418106 928031 401192
Output: 44

Example 3:

Input: 296 533064 992165 912380 148070 699832 71328 880608 226471 325540 72892 127820 259717 392459 938298 451816 94674 63278 225235 358526 544863 524250 537920 942527 777792 156543 104742 304453 452554 39760 795161 234606 336155 623413 11693 773005 470100 139027 602988 715033 98409 725342 227945 217630 89748 299659 75000 97476 192252 658516 254160 78150 18691 859160 206952 940718 371165 675201 752532 491717 745707 323377 920449 654578 371326 642001 532917 438183 385404 583287 587008 189726 592640 80922 77117 747019 667227 800701 198568 598317 909552 774109 950882 614469 30762 783260 902486 888499 921130 620593 873262 764867 699655 722507 45008 562554 630733 574002 610316 255075 89628 234915 772489 590477 574173 775688 986593 492503 85240 559750 427899 439740 636359 930957 583335 750124 240785 97…
Output: 153

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The First Peak Index Beneath Driftwood - EASY Coding Problem | CodeTikki