CT1732

Ravi's Ledger of scrolls

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Before the gates of the anvil district of Hammerfall close for winter, Ravi must finish the scrolls ledger - one figure at a time. 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 <= 77; -100 <= a[i] <= 1000; answers fit a signed 64-bit integer.

Example 1:

Input: 70 266 -23 897 -90 811 185 747 108 431 841 624 38 -17 685 355 290 892 523 71 284 67 165 387 906 1000 684 490 263 338 952 851 677 307 206 149 539 374 500 721 713 -24 596 873 895 750 410 682 686 318 736 979 452 683 52 311 489 296 778 778 27 148 607 686 277 83 198 596 -81 190 184
Output: 48

Example 2:

Input: 46 870 841 379 965 549 291 116 648 639 590 870 -61 674 687 948 488 912 -12 487 956 978 712 790 563 13 189 902 354 327 721 707 515 271 167 688 724 268 -39 260 775 773 42 270 -51 172 -81
Output: 6

Example 3:

Input: 66 311 448 954 875 -38 763 411 161 17 863 38 324 87 179 511 599 37 363 485 962 177 398 842 224 704 798 305 240 21 518 243 139 249 813 934 326 693 68 648 105 388 530 698 290 91 916 584 221 323 660 -85 86 436 601 937 189 473 969 210 283 -59 501 735 765 432 712
Output: 39

Constraints:

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

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