CT24700

Last weights of Botanist

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Botanist found an old ledger of weights in the timber yard attic at the quartz ridge of Glimmerfell. The margin notes pose a precise question. 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 <= 297; 0 <= a[i],x <= 1000.

Example 1:

Input: 186 979 22 239 642 236 148 698 184 26 811 17 586 248 907 273 377 474 484 815 134 850 24 764 718 394 862 270 544 856 198 390 423 70 160 238 225 452 879 949 293 653 812 790 233 982 536 675 220 715 579 289 736 122 157 123 194 123 479 616 967 852 611 224 437 571 409 502 835 528 670 981 370 178 904 221 23 971 633 971 458 803 457 948 430 885 987 283 614 946 581 361 264 578 753 698 911 183 895 349 976 128 878 420 525 563 795 134 364 837 343 26 519 625 377 764 67 600 248 360 453 710 58 146 209 796 528 963 968 333 921 884 652 433 867 668 273 416 866 552 217 710 774 189 322 638 504 671 895 358 201 725 820 377 514 327 49 738 207 8 462 2 240 200 96 27 198 132 39 692 825 649 212 458 984 159 30 455 362 265 940 237 988 501 568 128 954 14
Output: 181

Example 2:

Input: 202 620 191 227 587 731 378 874 432 490 59 90 836 680 224 544 547 916 222 514 440 498 802 100 319 546 246 133 366 263 468 932 469 746 523 461 793 4 781 830 550 633 817 467 760 535 95 535 33 13 343 313 747 195 244 545 903 508 603 511 963 768 187 808 725 354 480 832 559 830 33 37 814 501 971 920 51 628 163 883 413 903 230 63 513 384 653 348 342 429 269 973 540 685 398 555 845 895 137 816 759 180 367 248 940 980 988 968 747 871 723 923 890 287 120 675 125 148 916 929 432 692 55 166 786 700 893 489 576 655 897 713 48 753 989 328 246 916 446 758 202 939 315 868 450 72 296 300 142 430 49 338 261 127 179 756 827 627 567 66 655 465 903 336 507 358 118 877 59 564 826 57 249 242 493 239 1000 298 744 28 148 658 522 969 873 879 785 406 245 229 367 471 64 197 279 953 940 181 324 552 1 768 499 828
Output: 124

Example 3:

Input: 197 491 10 685 840 490 294 858 491 824 798 556 100 485 741 130 114 817 930 703 157 19 350 679 223 495 689 607 645 482 682 825 956 544 53 750 525 345 17 638 111 414 682 667 370 612 124 746 647 468 99 299 255 289 510 335 481 344 857 23 772 888 993 173 989 559 984 333 755 316 147 432 38 661 417 730 706 232 832 120 289 493 479 483 685 931 586 593 863 465 295 256 382 161 977 211 181 420 798 41 581 559 690 55 328 636 289 744 331 170 111 615 91 304 969 768 339 793 499 517 281 25 38 67 623 477 17 49 32 956 122 532 618 963 483 848 185 537 177 647 823 638 168 711 178 42 361 893 202 653 47 119 537 646 451 84 765 788 352 376 13 161 422 339 241 695 481 371 784 737 257 528 633 55 25 775 170 609 306 523 292 284 976 737 176 38 834 111 168 990 810 927 906 580 270 779 539 1000 971
Output: 101

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last weights of Botanist - EASY Coding Problem | CodeTikki