CT33013

Alaric's At-Most Tally Ledger

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

The harbor bell rings at the wheat plains of Amberfield; Alaric weighs the day's vials manifests and starts the calculations. Task: Print how many array elements are less than or equal to x. Input format: First line: n and x. Second line: n integers. Output format: Print the count of elements <= x. Constraints: 1 <= n <= 7213; 0 <= a[i],x <= 1000.

Example 1:

Input: 1991 713 674 150 949 752 268 376 437 733 505 883 903 174 394 555 73 1000 26 907 268 412 591 733 334 187 458 242 560 180 936 30 624 36 566 929 864 795 681 148 105 474 203 844 643 360 430 461 22 866 456 270 386 992 751 313 424 301 160 596 946 194 137 650 230 683 146 441 539 830 45 448 547 488 748 263 656 25 693 478 359 905 423 913 871 81 81 194 942 8 20 189 849 59 861 284 354 676 976 559 852 103 362 930 381 896 12 829 802 409 954 475 864 873 809 355 212 974 412 982 50 112 476 361 893 23 421 604 476 510 191 904 927 690 557 462 578 63 114 559 79 661 918 302 362 339 385 142 81 578 420 349 728 72 229 654 589 159 169 900 482 646 865 881 887 292 875 331 704 18 503 25 906 335 789 115 191 365 513 802 836 616 573 231 983 573 352 78 441 684 240 277 784 851 481 584 142 129 93 396 484 665 387 891 503 36…
Output: 1376

Example 2:

Input: 4553 885 986 943 280 789 126 565 210 497 940 419 131 630 577 718 622 876 381 922 3 499 81 875 5 837 601 148 799 617 224 876 759 845 69 347 609 951 111 356 357 67 990 661 723 829 424 340 860 519 526 470 970 474 476 846 315 659 230 400 878 472 202 49 104 234 360 983 402 6 199 746 23 805 772 426 273 679 841 511 806 129 473 17 114 807 201 928 118 85 551 707 303 167 707 334 937 148 590 389 550 331 674 792 670 183 909 955 287 335 972 299 479 517 70 534 430 547 708 147 717 804 930 597 586 560 667 490 808 30 227 151 311 161 222 40 641 22 799 885 895 87 456 648 160 554 978 193 863 675 825 219 309 854 95 279 0 149 716 524 900 964 396 360 465 132 766 692 207 829 459 786 718 739 830 865 168 756 230 802 307 457 994 934 960 168 606 883 687 93 753 69 554 618 551 955 906 335 632 743 172 848 906 376 970 98…
Output: 4022

Example 3:

Input: 91 57 491 259 400 172 224 206 836 208 563 648 430 371 751 650 357 765 883 668 910 546 641 671 816 728 951 246 18 538 762 575 26 98 829 630 957 6 168 675 615 771 470 97 191 927 209 345 699 31 436 939 911 792 580 626 941 71 773 21 337 699 994 214 671 326 776 631 705 622 776 722 390 516 965 792 454 346 632 814 317 426 59 668 772 71 491 975 765 462 915 689 820
Output: 5

Constraints:

1 <= n <= 7213; 0 <= a[i],x <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
Alaric's At-Most Tally Ledger - MEDIUM Coding Problem | CodeTikki