CT26210

Rekha Counts the tickets

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

At the saffron fields of Marigold Row, Rekha records each tickets in a worn leather ledger. The guild wants answers, not guesses. 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 <= 822; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 42 824557783 86542932 657023433 298448616 563886285 930180142 4510757 206582071 137255091 764005480 531582046 582473415 253182502 676805131 944904615 347259151 797544859 411857281 617024310 782346353 666286102 143344001 930412960 790272072 161167978 588114705 236867651 819591046 138936321 5870462 234057128 514376574 433670652 283255427 282110970 924523146 682254102 75388120 791141481 517708650 74916209 86423246
Output: 15

Example 2:

Input: 234 966762846 760683177 469203510 103293219 960968859 775945940 534945536 94559378 406859610 741281774 84606700 589554038 497804056 600873484 839820106 587452268 936096993 840436433 840310733 334526085 122324595 315066747 920324894 936520819 923547504 172744014 332104780 694200046 881880161 802910308 808921825 307606986 329733269 528456580 857735437 609525896 634794272 240461208 389090345 821170871 97469068 800765491 792264795 321307530 240546626 515752555 779744613 400904251 85867668 700237595 769250698 660150916 855795672 471862172 44790340 569377894 99946477 235637783 957974409 610980845 346792689 417307389 306810464 37177868 444822659 275453362 592876505 243391613 488352497 44201730 690514393 929306253 356140338 725689869 575097762 965550454 792345218 249733623 121737928 914449800 3275…
Output: 121

Example 3:

Input: 591 867666425 948565157 672132935 334844723 166307997 238438589 619924560 951150772 685653532 691341866 997440532 538340124 476157440 75271079 803063456 23915299 434032085 849007233 334526599 160508511 804067540 902328294 262999951 270374197 401006966 723704928 753789088 105439473 733184354 665188331 721654915 614879440 621599004 568993806 183477947 213230798 597751047 66116206 230360832 607052548 999853286 883430039 35582367 36438787 442189387 912617835 101082489 803528297 842092800 624624482 235066556 382444078 83313692 344455250 890364856 694226272 763503595 26305523 625096846 662061018 856781824 509569198 111598643 927711634 705237265 345341272 12753505 646799445 774139597 821921217 694237990 801173752 56340189 547837479 711632323 626007074 589446895 543937055 247953182 74737642 521157…
Output: 41

Constraints:

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

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