CT29798

Crimson weights At-Most Tally

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Hugo inherited the signal tower at the old quarter of Brasshaven along with its curious bookkeeping system for weights. Time to make sense of it. 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 <= 7980; 0 <= a[i],x <= 1000.

Example 1:

Input: 7520 578 951 397 589 714 1 638 60 756 552 271 703 345 952 240 316 198 210 977 146 609 969 815 350 408 987 966 780 46 625 153 194 401 368 200 810 718 923 497 183 831 226 458 391 611 228 271 858 152 152 126 629 490 606 726 737 973 225 796 839 783 385 60 36 176 340 373 585 846 663 385 635 552 47 79 483 928 235 461 996 209 351 357 451 931 552 368 603 751 429 759 3 944 818 527 287 809 395 622 614 854 735 481 959 584 932 959 190 805 690 203 385 363 288 740 456 167 837 834 881 7 887 869 272 991 727 231 508 43 700 250 480 964 45 493 856 429 149 643 18 971 892 724 622 929 935 350 249 19 958 280 260 9 975 367 740 109 548 782 169 476 595 723 479 554 928 31 63 951 518 343 298 154 583 819 877 529 427 703 920 173 755 808 814 957 456 422 672 218 53 246 456 293 320 801 920 397 106 532 369 644 233 314 628 …
Output: 4410

Example 2:

Input: 7473 356 932 362 188 733 662 203 451 535 382 513 863 849 479 926 3 537 188 123 121 841 761 31 697 794 490 323 931 93 332 854 483 765 544 514 885 820 455 544 122 693 139 358 775 343 732 64 610 402 498 305 239 187 293 727 365 936 587 937 542 861 283 330 230 991 83 823 545 231 554 295 844 276 762 896 577 217 154 356 314 365 685 405 267 416 489 34 226 899 185 834 267 978 859 639 505 513 251 117 604 851 986 497 397 605 152 365 676 56 35 703 68 463 278 390 569 862 18 873 784 95 450 871 882 922 119 312 610 174 243 656 242 451 502 734 756 911 734 874 29 0 745 201 53 358 267 468 517 852 895 374 340 217 572 601 407 138 878 17 723 652 552 422 814 902 530 832 895 965 580 282 418 386 85 606 138 437 828 466 143 704 41 336 664 111 388 557 146 650 659 332 140 998 637 829 183 450 77 186 687 438 903 47 419 …
Output: 2709

Example 3:

Input: 3758 664 7 402 115 547 730 975 809 746 446 931 387 421 289 328 59 408 638 269 963 345 189 612 782 762 538 786 237 941 173 286 892 264 245 341 554 708 931 738 954 431 450 326 904 670 229 889 654 460 714 316 455 638 42 105 348 900 296 120 397 242 699 203 697 964 744 202 427 556 954 832 59 445 665 977 66 397 797 369 397 984 307 360 196 337 127 598 884 930 20 203 467 790 760 743 116 105 245 865 299 211 845 191 203 824 554 590 431 214 335 282 927 852 312 644 741 737 25 468 831 53 733 481 579 914 473 39 1 652 970 283 924 666 990 331 531 130 177 351 159 239 24 153 947 885 12 702 804 369 556 286 714 666 215 759 685 390 769 698 470 77 472 789 400 681 712 747 955 570 399 705 921 608 590 423 260 676 395 1 28 247 617 854 549 544 892 251 698 822 264 172 238 932 849 574 574 204 591 75 179 457 919 252 36…
Output: 2409

Constraints:

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

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