CT22819

Last coins of Urmila

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Caravans arrive at the cliffside roost of Stormrest with crates of coins, and Urmila the assayer must account for every last one. Task: Read n integers and print how many of the elements after the first are strictly greater than the first element. Input format: First line: n. Second line: n space-separated integers. Output format: Print the count of elements a[2..n] greater than a[1]. Constraints: 1 <= n <= 206; -100 <= a[i] <= 1000000; answers fit a signed 64-bit integer.

Example 1:

Input: 135 646031 8654 423761 101171 46780 110657 524055 936045 45261 153875 14851 462926 749221 537602 599784 550407 694551 339547 742930 227805 317198 642773 636224 787163 562743 609515 414062 323922 766376 106807 832763 992471 565832 185587 589741 485921 223715 34378 739404 966233 8627 970652 425944 156609 298362 190703 956431 701964 41119 212246 80003 589454 703110 449010 900758 808619 462584 461619 922317 754019 408289 223044 608630 896579 734236 840299 333781 98316 747748 108980 627208 888296 645394 305974 654535 532134 63015 713850 840642 685803 42628 244885 703357 785341 109341 475192 258680 599815 479204 204907 696303 301229 237781 828768 885185 738763 926353 551857 489344 760052 995707 631654 698577 497228 860073 435073 284064 380839 448432 854256 704280 545645 671885 558308 198139 1512…
Output: 49

Example 2:

Input: 39 777222 554809 330663 337603 666809 417638 438559 473431 707441 182341 254475 284443 147888 563846 67586 897191 823544 62132 344781 302072 626995 707179 843792 148749 98101 184203 467349 530557 822224 6516 441363 590226 127174 27059 189156 607178 918197 115691 447489
Output: 5

Example 3:

Input: 58 121460 248502 221858 722056 697211 316171 905412 383466 333189 42282 424879 375037 42309 962585 454395 111070 505502 179837 36199 704996 421287 486216 189594 193246 982718 720043 424089 286987 887153 704623 383821 613985 963271 903014 452849 151321 624293 996278 529637 887227 776133 775707 397645 892027 846159 217078 998729 658360 728087 445841 772005 400635 273685 936721 596450 390836 247501 716672
Output: 53

Constraints:

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

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