CT33581

Aldo's weights Reckoning

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Every season at the cinnabar mines of Vermilion, someone must assign crews to the morning shifts. This year the task falls to Aldo, armed only with the weights register. 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 <= 13353; 0 <= a[i],x <= 1000.

Example 1:

Input: 3592 292 271 245 653 377 394 695 610 94 827 730 493 66 201 24 881 8 259 223 791 994 949 603 779 517 260 12 924 259 656 50 65 668 421 770 58 207 222 26 312 940 964 407 691 301 986 414 381 415 4 819 867 691 86 505 419 944 462 192 463 401 101 881 761 311 919 908 640 663 123 647 145 7 861 870 736 576 615 849 387 731 69 541 539 497 409 292 341 127 876 225 642 54 547 581 293 675 119 36 554 520 310 799 403 570 220 380 829 826 566 92 87 194 54 156 227 542 444 357 313 762 600 722 405 465 318 997 893 91 709 959 371 130 452 918 17 470 569 731 239 996 897 691 187 577 76 168 321 410 797 688 557 980 506 388 476 871 218 642 160 635 503 130 579 699 793 890 772 41 394 914 308 979 796 210 962 820 774 652 94 341 603 121 12 383 338 343 183 862 722 862 699 804 614 471 628 140 958 81 542 121 503 303 488 74 545 …
Output: 1046

Example 2:

Input: 3663 948 632 216 919 996 259 288 640 245 61 938 800 430 851 196 700 325 176 190 490 553 699 710 161 232 178 716 639 739 914 719 233 360 440 754 50 34 843 422 300 349 969 183 67 159 750 626 782 851 343 301 464 172 175 630 519 289 924 10 969 981 104 943 573 97 608 896 530 711 918 447 806 956 61 203 690 287 48 958 903 201 882 152 694 558 704 624 389 760 50 17 90 333 512 992 954 286 649 603 633 355 527 179 258 328 581 866 741 606 818 481 328 495 997 740 194 110 273 500 999 357 174 616 949 902 264 202 414 529 578 2 544 96 421 590 670 494 428 782 959 859 155 259 855 479 686 72 864 802 992 457 28 610 394 637 972 0 704 674 463 922 228 910 590 115 871 761 223 757 103 731 720 844 287 98 42 77 25 222 214 773 9 560 973 134 300 933 320 973 993 809 398 314 912 892 125 794 366 867 546 569 55 538 984 887 …
Output: 3482

Example 3:

Input: 8326 574 516 982 892 908 967 36 334 449 347 790 394 145 557 29 825 581 188 889 982 363 450 235 624 306 152 546 738 125 958 548 300 160 824 605 435 692 212 753 745 729 327 866 889 849 864 699 847 959 854 10 71 659 948 912 444 557 523 834 399 555 332 127 419 814 837 645 557 203 16 802 955 837 837 198 929 718 611 524 364 454 398 682 793 531 378 754 484 773 757 509 132 893 348 412 385 495 180 507 686 552 848 634 257 363 367 208 369 227 295 174 373 431 552 285 457 538 363 659 180 321 964 703 938 929 749 377 185 548 335 912 422 525 252 733 601 466 545 629 559 92 248 678 400 966 468 484 938 335 928 336 943 242 346 101 487 657 327 504 891 52 540 140 759 227 722 900 576 456 182 202 28 136 652 60 765 530 702 326 767 220 643 684 558 431 749 724 208 869 101 406 425 863 815 445 562 489 957 769 132 115 …
Output: 4822

Constraints:

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

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