CT21797

Botanist's Obsidian coins

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the maple sugarbush of Saprun with crates of coins, and Botanist the auditor must account for every last one. 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 <= 223; 0 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 55 437855 981513 149024 173311 124517 483829 75420 139959 112360 289793 35279 21625 259351 284505 835007 522741 876181 902651 268209 351265 598152 608926 989691 620472 287599 324498 291215 395500 435344 607903 809795 898522 849256 400431 628399 17666 45241 998524 451958 307486 925084 879281 412351 888009 236434 871714 661283 136768 157910 927640 85336 428074 561313 485481 689235
Output: 38

Example 2:

Input: 156 403316 989895 759987 851541 171477 879072 733806 875762 463565 799519 954954 600328 489661 593418 259984 906312 57441 691961 175779 532890 671072 880922 770143 943742 627648 395641 214062 955338 285812 499907 313252 67555 544745 425352 655502 163059 885641 345969 429908 297466 272329 617067 562975 370129 122410 582753 97395 151941 744576 859292 358442 901970 120047 304914 307720 484882 67907 647054 849566 548131 967214 221436 198068 245572 771598 605272 536130 441842 201530 405461 846609 894144 161510 700105 927715 953811 816794 776269 190040 616963 462260 757332 536929 644235 411614 930697 820964 912149 90570 221651 555130 991147 663492 940546 527594 40078 791740 713582 71314 731498 158424 496584 149409 34856 634378 444114 444252 318978 940507 866011 82232 833908 554014 486434 516841 …
Output: 92

Example 3:

Input: 38 365667 517720 148811 635925 524097 882775 492960 608703 298251 837337 17781 17637 192624 739608 569532 356027 404626 86025 589825 701258 815031 100451 538826 775590 730422 147930 332064 755892 351628 742417 261951 688017 585271 794042 238636 391678 972130 415468
Output: 37

Constraints:

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

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