CT28890

Amber barrels First Peak Index

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Chaplain the measurer watches over the fjord village of Deepwater's stores of barrels. A careful computation stands between order and chaos. 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 <= 593; 0 <= a[i] <= 1000000000; answers fit a signed 64-bit integer.

Example 1:

Input: 355 948035234 176460977 2332799 966965659 612672145 892611023 108850455 677954204 226240835 387479573 866863792 303319166 640405913 925622526 598344272 952315076 489657700 675013248 27132063 410298395 268075959 773392321 212638815 528929782 352794952 996452618 661681974 815914506 313065525 219711273 147492407 885756040 729835061 236938386 598400968 346551130 33213944 388793091 391831212 195710990 747319483 273741225 2238283 389828766 370323100 585862413 567466475 914355031 442904761 859260112 175787291 193769914 404723321 970147911 39563231 515851862 364785008 146339906 537327991 428907011 652903136 356087259 788434648 158729083 731852270 997699237 255393353 868775721 775388909 659434915 94604272 456377938 316822647 46352239 113834921 176543120 810954181 243237482 90931624 294414617 522982…
Output: 66

Example 2:

Input: 499 23908472 106407974 515425871 894273717 966514204 119093739 477352728 242841051 606901247 285323387 113096528 770851199 522041064 933065931 801316322 205192937 87879831 63711956 643426889 925539374 55068331 122941484 330974004 644687946 397898978 690459459 951806808 6131365 659198993 441663087 320719627 875457559 365817834 152910734 24671842 507491340 401283384 866151895 971205472 153045883 667801238 160419373 806120752 5359337 72825949 556175900 130970733 732606430 695540776 324786503 980750577 864218252 69796355 868751928 328320361 606238477 565285819 658847746 194096571 996084977 401818025 907533378 810516780 105954400 871925420 598875348 772952726 77279439 537998919 839267477 373166697 191669650 384127217 854083472 205699480 330225031 326954453 672036189 33426921 890991674 583077613…
Output: 345

Example 3:

Input: 217 695608933 305587213 386491690 92772308 664153871 184875293 579115428 701782550 588432225 282838338 859234508 841707158 597292389 914959793 655338998 121919262 396556541 189730761 900423562 977533606 49176656 401515480 321087896 335329226 233859829 167986401 286500272 998974245 142893916 821789236 730346041 913912698 905569590 378297873 148016956 736487993 8186536 840701290 577437910 540759873 897358772 906553331 367055257 558534464 413187255 833313427 310784375 867228057 935402864 61446598 867160105 406846267 186645099 741506207 642898787 971214543 135940863 460925638 272665481 407854641 320712790 578961409 103082771 327731191 990537940 495862571 13022003 106948724 393630775 100249994 541369253 385480240 503726783 912444608 178738430 632988297 986192987 515981154 200735937 850760865 33…
Output: 198

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Amber barrels First Peak Index - EASY Coding Problem | CodeTikki