CT26977

Alaric and the Ruby crates

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the crane marshes of Stillwater. Alaric spreads the crates records across the table and picks up a sharp pencil. 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 <= 596; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 548 218282 973355 934162 507600 189077 528853 93901 988814 907497 752660 470416 43294 372675 51688 187236 849212 150690 553911 630628 629814 673555 341154 781332 809677 616190 590467 979660 535080 429028 592416 626832 361140 997434 358018 85532 624279 79233 424435 524846 62580 391749 961672 162325 691627 98962 144898 916696 2221 862599 588069 529634 458899 959182 852317 247772 287162 229832 914697 533664 913202 645646 608310 612227 979092 799259 718121 388470 798188 456100 23666 274717 205042 917545 906061 101074 561578 521692 810644 706734 253067 161135 368227 790874 49033 706839 528549 42652 427462 709730 62320 779511 823385 954251 737052 804094 737503 662962 184947 563702 148794 26678 39932 718281 15074 236543 21649 173266 731566 911458 761981 128766 202635 727924 912286 419174 824808 4…
Output: 33

Example 2:

Input: 587 209849 508726 308366 763871 106186 250313 865741 957138 618645 116948 285851 642458 491498 433153 416510 374586 715805 307848 101599 546896 23643 787457 77578 814515 43328 345405 837708 830202 936206 247531 515469 360222 971103 622978 307019 679019 234048 308876 906024 837223 785264 898070 703753 380918 512566 944075 124435 804424 565437 312442 959827 425899 555050 354307 272388 3294 356912 115674 918091 579612 732927 562942 469937 225030 224937 556555 888607 265305 400794 244197 389566 293647 362464 691974 5710 557919 120412 657853 824392 605291 227067 563497 2401 734774 997762 157577 784555 544781 565913 899848 544584 204455 883489 712619 917523 446677 503452 292043 898787 915217 733617 68333 715191 782813 940104 977043 681317 369041 942229 241218 897620 786568 243852 960391 184312 2…
Output: 85

Example 3:

Input: 243 329627 263603 370060 845449 128841 486746 528836 991576 365914 294153 388288 468933 64831 776744 490885 5242 654158 540386 860120 511818 269602 748111 316995 822687 263346 914484 476085 827614 793685 556014 891683 788805 820381 582476 973395 851931 430901 910673 383490 420725 841211 633075 9216 776736 910035 635729 175485 208951 607567 902122 687343 116269 400159 919588 967007 893693 569869 525585 960213 141359 369168 844482 843690 120032 139519 818424 981072 501604 255333 294703 442075 721555 283064 949792 393771 590012 447182 62137 890007 510080 605584 188414 55703 317282 612150 183093 164114 779672 721562 681359 336449 437163 852789 344188 683739 115600 501260 474365 13176 915683 510581 884564 436335 306391 800489 963682 75357 461108 464282 621120 611593 755820 42694 15515 4232 3667…
Output: 8

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Alaric and the Ruby crates - EASY Coding Problem | CodeTikki