CT30382

Mina's shelves Reckoning

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

It is audit day at the dune sea of Caravanrest. Mina spreads the shelves records across the table and picks up a sharp pencil. 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 <= 5111; 0 <= a[i],x <= 1000.

Example 1:

Input: 4097 672 924 363 47 3 391 519 328 524 169 55 970 161 605 277 704 446 543 619 875 44 317 811 268 964 720 839 915 895 249 866 628 292 238 16 84 710 144 397 504 862 402 573 150 844 126 462 970 670 461 286 249 270 458 610 492 68 700 373 70 115 30 193 422 384 625 745 601 463 310 497 138 163 636 477 922 468 642 130 728 254 237 110 387 532 355 371 275 553 776 992 562 676 64 579 214 564 228 253 421 184 61 630 828 934 391 792 963 450 602 712 194 595 362 787 921 730 372 749 855 370 844 163 626 383 135 973 919 232 916 175 567 385 463 834 993 640 948 546 11 785 554 301 437 811 543 925 886 696 547 71 359 715 777 522 390 153 523 104 412 574 378 631 48 55 1 162 281 930 161 122 878 208 851 842 908 406 773 76 588 863 724 9 905 632 948 209 13 490 578 396 6 483 824 65 366 127 44 722 24 173 864 208 214 203 57…
Output: 2730

Example 2:

Input: 4771 648 814 672 321 372 652 714 563 994 183 834 166 699 6 21 83 879 304 270 155 573 589 595 326 566 398 738 516 69 639 472 79 209 711 312 448 328 599 773 927 610 8 588 865 151 362 532 846 271 1 67 352 882 151 354 868 960 200 554 861 94 333 412 986 277 275 165 262 815 616 117 74 718 3 215 651 284 171 140 772 33 513 435 429 27 154 857 884 796 768 431 280 885 509 913 258 300 630 901 228 419 320 699 57 2 299 372 100 749 655 846 868 295 525 354 647 471 908 93 921 641 684 472 657 719 313 217 751 580 504 191 993 676 70 24 109 758 732 386 148 311 669 667 128 858 426 365 441 408 404 306 805 124 68 269 9 616 888 59 570 677 277 396 718 30 149 554 499 438 831 135 246 686 481 189 522 799 856 360 508 449 9 176 926 226 759 84 871 905 908 517 426 983 996 14 217 99 715 35 178 358 326 886 852 131 883 119 4…
Output: 3107

Example 3:

Input: 3768 664 847 692 820 937 401 547 893 214 434 546 295 653 917 681 104 810 196 864 953 1000 249 978 864 623 315 995 731 278 478 112 281 480 473 682 451 823 121 163 695 48 751 645 142 340 569 78 206 378 804 252 644 600 889 861 721 328 859 634 34 200 63 448 776 880 89 91 976 100 425 564 426 716 654 673 566 589 757 603 581 921 581 291 403 866 92 766 192 892 779 884 999 251 98 548 189 587 126 251 716 375 934 0 831 867 949 81 47 803 509 58 603 227 275 362 493 562 335 558 861 872 580 967 588 140 164 704 421 561 823 114 408 454 842 299 887 742 449 76 515 509 230 291 988 929 790 737 405 978 143 776 186 830 292 242 587 934 759 245 550 656 987 619 73 1 18 334 781 789 887 884 846 630 862 694 366 314 21 805 81 825 931 424 559 828 390 38 879 982 219 340 869 355 95 725 352 680 818 438 910 906 197 976 708 …
Output: 2500

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Mina's shelves Reckoning - MEDIUM Coding Problem | CodeTikki