CT31683

The crates At-Most Tally Puzzle

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Morning light hits the rook towers of Chessfield as Dante unrolls the day's manifest of crates. 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 <= 8024; 0 <= a[i],x <= 1000.

Example 1:

Input: 6247 651 430 75 872 820 511 315 651 766 872 307 318 742 465 392 787 909 211 779 201 357 786 968 861 433 96 115 738 86 227 591 830 625 519 691 498 573 207 364 166 116 849 964 728 699 695 173 482 961 39 423 822 617 579 875 300 661 532 449 242 726 15 140 780 496 118 438 141 368 125 703 335 125 719 654 953 142 946 643 471 466 546 745 315 618 995 720 225 182 757 893 864 16 971 861 630 831 977 357 573 545 989 102 292 24 542 260 774 87 866 642 703 601 183 179 554 264 40 312 996 408 695 687 585 503 785 962 662 820 68 522 361 320 556 575 365 663 882 1000 281 909 127 174 56 548 783 636 171 25 31 284 84 845 380 891 359 962 344 967 687 904 619 619 790 363 525 855 570 842 638 128 439 954 455 716 892 958 414 713 9 487 125 724 313 241 565 380 488 929 972 142 615 422 418 480 635 106 521 253 364 760 495 54…
Output: 4107

Example 2:

Input: 1380 325 686 872 262 17 478 766 141 223 104 134 106 74 195 211 274 152 985 325 434 663 387 154 290 907 931 645 444 856 35 462 421 764 627 309 637 498 40 103 148 104 80 254 840 927 588 458 611 448 1 968 383 957 612 410 424 142 0 691 629 319 504 613 99 219 795 796 61 881 710 989 866 918 138 391 8 357 147 933 891 131 483 540 42 346 332 107 384 511 807 313 225 435 379 483 646 988 773 3 795 848 524 902 43 356 560 409 975 132 758 806 677 684 115 50 918 76 875 326 383 261 1 518 41 839 115 927 909 358 22 3 202 909 64 976 368 576 679 553 459 911 82 336 531 969 78 765 564 690 280 946 880 14 213 241 37 562 913 739 149 550 536 725 292 634 409 79 606 539 358 126 523 159 74 974 727 16 142 322 967 261 692 714 253 466 44 148 363 280 344 225 467 218 809 257 863 424 871 111 428 293 662 14 522 580 904 614 85…
Output: 460

Example 3:

Input: 978 576 342 780 716 613 332 124 973 713 52 839 801 810 157 985 260 325 536 767 895 440 577 576 62 804 304 178 979 36 526 755 613 440 375 367 810 481 351 74 189 893 94 21 828 785 219 211 285 359 520 304 618 306 830 698 159 168 350 900 854 576 933 207 832 629 223 911 194 917 599 378 573 227 720 993 387 996 670 99 360 272 582 32 527 9 892 59 329 661 568 572 693 647 315 818 145 525 493 979 548 303 636 339 258 280 49 982 4 798 166 735 646 376 13 658 293 16 329 907 549 422 225 875 731 374 615 147 145 473 316 92 683 879 653 278 708 616 386 763 58 670 408 263 591 33 601 114 440 625 359 655 670 832 628 954 281 93 410 389 76 855 845 396 661 823 982 168 643 122 659 820 675 959 774 140 333 920 286 495 365 853 757 779 720 564 619 727 318 950 942 909 924 120 11 849 434 629 509 791 293 494 686 381 163 97…
Output: 558

Constraints:

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

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