CT26365

The Frosted tickets of Eklavya

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Legend says the vault under the fox den of Rustwood opens only for a perfect tally of tickets. Eklavya means to find out. 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 <= 645; -1000000 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 625 376054157 620816741 217765429 303048594 369023780 904202473 342777591 931388897 864997302 547078497 617563582 626017955 258466398 902080410 779145706 149433818 88328640 432744567 959350153 308345760 831253276 599464639 229267970 771363707 35468617 416811587 701077678 908566431 539604055 265045070 497170910 22048712 44525244 920298459 845875321 61598872 282855333 977827746 894360834 794008971 841490213 896939988 914426359 600662746 595248128 76276100 192865881 966699040 262362903 485686206 774091796 631526950 344120317 669636111 818647519 94705792 581098699 185054212 557033993 526267170 296248346 261158268 645114413 919808056 28671712 874074278 580647037 360943390 205030926 772854768 704898490 345225435 234881581 969840279 655397934 717649616 168752254 -12466 964529560 946161219 4868080…
Output: 320

Example 2:

Input: 82 416640464 643731336 866721131 484258822 576760552 117850900 46293662 76419894 112161811 263165858 308504582 33331311 919909535 827734959 328670312 669860184 729953071 272993774 557266346 746421388 817403193 784970002 716582496 54526958 413967942 783398416 219636702 792006700 291167342 720372569 817738786 684532410 982472376 565282437 363257963 994898139 538625455 474543009 526078581 403142219 200075033 676854168 566894951 314386973 239171331 64833943 41821810 600228799 476577961 954230510 999837288 916010133 117738031 621398428 356147729 725396086 428945846 238856197 907081283 753758354 759179703 522805496 975140706 936013061 150272566 166860061 60547501 960357639 804780409 278644923 165917845 404799307 581621804 339912281 445626040 700687724 100963977 227572650 298899885 620279466 6050…
Output: 51

Example 3:

Input: 409 769729245 288121183 613057880 891398677 723498883 40369741 364364259 718988814 490749790 625797733 690766720 751797036 292782666 246377839 559737669 615799925 985277577 39108633 774460930 205849684 686836004 585863081 803765833 817191681 595584727 963531423 728198306 784365062 922996809 461191553 44215402 70068751 709880518 356867215 435156359 899802998 263434891 922036559 526834486 489794658 418942760 536913263 525393415 520304848 625212642 345859352 646134411 282370315 916970202 891234563 966813408 101453843 32642367 800003083 577415817 614395918 498218838 664092571 356833935 596825393 955279791 973136470 181946708 648487828 595151321 100440909 346839485 907846821 612607877 843010653 38156553 986937340 530830011 862721660 125579127 359188807 703307501 145286221 816662755 738832114 83…
Output: 161

Constraints:

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

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