CT29073

The shelves At-Most Tally Puzzle

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Morning light hits the savanna camp of Amberplain as Maya unrolls the day's manifest of shelves. The tally will decide the next shipment. 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 <= 12927; 0 <= a[i],x <= 1000.

Example 1:

Input: 7480 49 511 297 643 742 124 164 226 805 103 233 918 354 27 150 260 10 490 136 261 756 238 830 987 416 454 197 596 446 30 699 295 42 39 202 634 305 739 805 901 511 945 818 915 176 893 649 898 739 121 501 31 114 96 401 621 516 55 591 118 760 352 595 190 593 685 108 355 643 330 33 392 915 454 766 866 121 527 679 931 555 263 816 595 838 422 700 951 523 210 997 29 819 697 258 349 463 734 819 300 696 557 242 375 381 338 140 360 122 538 767 458 472 639 74 230 918 849 339 387 977 371 797 881 688 787 91 636 962 205 56 194 668 403 181 884 160 256 803 578 594 979 637 820 219 152 9 699 215 179 142 219 313 911 683 54 545 929 52 259 290 269 641 426 910 760 128 212 802 691 456 318 157 518 344 405 383 311 271 932 598 991 955 732 876 903 93 68 686 600 784 496 880 800 3 390 485 448 757 170 116 634 961 970 6…
Output: 355

Example 2:

Input: 831 191 721 843 465 304 254 975 760 465 805 709 408 653 656 776 880 655 291 955 540 190 957 325 202 232 827 181 355 547 795 343 123 687 544 580 321 144 18 565 290 32 781 451 734 958 161 866 175 193 621 800 237 992 448 2 198 449 164 915 924 76 839 71 108 292 256 618 584 782 617 284 963 730 297 532 139 159 938 126 449 338 882 948 653 580 229 607 158 440 929 991 812 162 829 994 873 395 324 701 224 526 987 79 295 39 973 322 280 536 522 970 498 989 723 737 735 769 398 416 750 900 587 765 555 878 956 686 744 274 645 189 994 875 605 736 359 31 180 722 537 328 389 740 421 615 138 715 944 359 16 876 603 906 578 931 976 768 866 898 955 768 480 178 905 253 591 257 488 870 658 956 910 909 163 362 702 269 509 948 692 49 608 80 805 3 356 3 530 440 394 646 58 187 467 740 607 259 860 694 227 383 631 392 6…
Output: 142

Example 3:

Input: 1908 757 431 673 130 455 961 947 289 115 182 981 893 215 309 468 516 134 720 930 829 156 709 742 915 498 384 430 487 899 220 726 655 701 44 662 270 442 32 656 294 203 761 533 796 749 999 991 352 668 264 137 511 864 181 409 537 571 784 177 811 726 280 257 747 730 94 497 745 898 425 994 697 208 56 951 504 991 555 800 21 256 720 696 420 89 131 92 195 477 782 934 460 386 340 544 498 75 269 777 82 801 978 279 994 683 799 26 783 607 389 204 632 667 879 71 796 761 743 83 327 401 941 197 187 104 44 643 418 39 302 338 527 816 594 214 689 969 277 353 322 892 100 424 94 704 917 931 878 421 565 558 378 419 260 131 614 714 320 199 350 173 540 527 63 493 501 576 187 701 863 101 826 291 515 592 328 982 681 922 740 582 724 621 183 480 344 241 996 701 640 200 329 519 594 951 587 389 425 724 731 483 634 525…
Output: 1488

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The shelves At-Most Tally Puzzle - MEDIUM Coding Problem | CodeTikki