CT21713

The First Peak Index of Verdantstep

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the bamboo terraces of Verdantstep, someone must prepare the winter inventory. This year the task falls to Gautam, armed only with the ingots register. 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 <= 365; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 23 991256973 832750897 53451806 210501086 763651552 262690035 641160773 366057802 958566586 239555888 804509752 757883650 501864538 809546320 661850703 601037299 400581540 138524285 987623636 271890471 157832683 274201444 29821748
Output: 1

Example 2:

Input: 207 790051884 224770875 60091132 230191177 950605569 601317175 76347124 389992381 138879974 214723307 249192465 787131419 412219167 844976930 306432452 569233657 376711777 166578753 831553729 147930980 918921686 498997977 838758521 366847119 655204849 706246995 35774634 621311241 30417341 239563035 231959159 76870907 291038584 434579297 178511099 260463137 329072604 601288155 635647201 903147042 921309278 576972159 166518052 181457517 115901277 652694113 720264468 1976201 560995930 210629918 146593678 576903152 166896930 414625637 112784573 369037992 27224869 321108688 591199310 630324567 478008780 239638273 362130196 885441164 360902928 614164534 287354565 89487204 495509835 682423154 593165921 434328745 23793756 544844471 919457175 161337231 86567650 202843007 459627311 392163817 553346118 307462819 969494035 876706339 316891517 568351710 754969793 171641493 740223539 81859179 207858065 269076371 90634688 388525868 860435871 6311241 323150731 129728199 508361063 800869008 932262039 569579822 627467972 195391948 4644454 107004928 397711722 430303737 486569372 283684570 462235914 920575435 798199637 235865730 278561545 872962416 722386681 384233877 338158054 463298398 673796917 803284220 659047791 386444602 44719407 471422686 303434015 522482599 897409261 598025283 698541063 631326969 256607801 80181049 602250299 69868664 517516316 706004387 372092225 762988268 616751008 320800569 665257017 540837541 439240102 41639009 932542838 358485341 755735119 781063900 266477300 98309597 688051398 456471029 928556855 723112727 776048482 818920485 191339397 243894554 265624101 909485136 425084817 468621150 998547376 817375854 501047239 711467923 730095984 639817362 250917437 361845724 16053596 184344697 680377932 115157339 627409508 505639030 439167360 988135837 157132243 214448626 912485327 200346444 186047873 919099280 590689874 632119273 727353280 497864637 541650707 848387443 781180946 214694933 366280651 618145626 518279926 478788326 188624885 273325805 909877158 205221470 104759539 627962413 560794052 211942967 967550029
Output: 165

Example 3:

Input: 32 984876792 921507391 928189076 516279098 357931415 69998859 516653809 4874326 430593322 297157750 951692033 459145960 596525012 224292917 960735481 630531139 523456474 951251331 581590653 918092450 913582158 922647968 790326467 127080112 860428583 794670551 175724822 179599631 287222650 202049 135795722 972081413
Output: 1

Constraints:

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

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