CT23322

Cobbler's tickets First Peak Index

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Before the gates of the quays of Driftwood close for winter, Cobbler must finish the tickets ledger - one figure at a time. 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 <= 997; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 344 472780876 65231817 700351970 954637606 630920736 102541265 719904371 876987205 764897194 809203612 332171138 179321362 152771548 649969523 160411034 488291895 900370341 938323203 848697201 718798379 906436008 342126293 794620165 859985130 698745030 706747493 903666576 172280548 531339102 266387303 577947059 649077924 737902327 123905370 664885656 740833395 185081381 916821561 451416611 480142766 682255806 25349821 358199961 743695275 289017800 637489578 450434247 876223174 506211135 812507534 535574522 118554710 732671880 536966232 227379788 676231777 494770402 532726663 755612200 495061038 833743857 85306446 588329851 324795016 197497800 834359791 888983091 516492059 876969446 375921218 882547396 371313349 227742637 758172136 78597198 260085629 958434413 535143821 444692934 97728430 6…
Output: 161

Example 2:

Input: 416 481599796 914174988 500320651 582719090 784834020 753521949 877507950 941097677 714472428 432389009 571872976 910904071 839724388 53779487 496661628 9399999 606483683 837618572 304070711 249173771 224338385 573171265 425612525 493209111 35381441 345921448 252190772 321464639 661455545 767197897 150081766 177639626 707565480 349556105 195276379 422894778 898810045 597908716 509517108 102033612 544312461 570978453 681706283 61105096 286209643 319973000 530956157 744843731 661889845 777595600 197937978 505106966 76731199 729821387 521478386 923840346 703544412 3000392 887473133 192480679 772757603 737954709 804418852 989122542 952326328 168253240 317775346 767816574 397719397 721573698 962620436 226447992 926379317 742296372 915794831 716961992 690014528 820751873 276708070 536058618 2880…
Output: 394

Example 3:

Input: 265 533261914 972378410 224073796 426559629 463849033 934014576 920588238 310219621 496797691 401668782 524041750 408059457 936310210 754999457 858553459 532243719 647810942 201782334 549995597 259156209 476037128 591766363 4500379 246606025 688377563 504994959 946042578 884972117 351208886 438968297 892224977 22583727 308606583 591241359 197920525 351074089 645603087 561086041 948232019 34843558 868455317 868560040 149086689 44087126 708338925 886366117 261891744 188316306 572074007 899676748 148096459 824323982 260385559 123976764 581104927 15373129 827573805 60943098 888430650 536865170 969666555 313489896 750446562 885958609 163533359 292037056 529808533 248409644 788943939 92904605 709892752 448512282 231448786 425615774 723424746 227342538 665405878 448087865 534583753 826592337 3279…
Output: 155

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Cobbler's tickets First Peak Index - EASY Coding Problem | CodeTikki