CT27967

Marble registers At-Most Tally

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The valuer June has been asked to assign crews to the morning shifts. On the desk lies a long table of registers readings. 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 <= 787; 0 <= a[i],x <= 1000000000.

Example 1:

Input: 545 804080193 807164826 925528792 517655806 763086911 809737934 860719536 476299565 453295323 699280963 872906332 957437218 533940945 234126204 931935554 851304129 346993259 699385980 220635269 383628591 685700600 51773870 926020995 183438930 573185835 496561903 378125695 1367331 669601693 719173848 955229208 383647275 649641179 181154548 372937583 686268013 558275906 75071253 145809718 905534289 204981524 496296342 605972830 210888149 96662822 232336180 406764262 584227906 50511783 443190739 175954628 206414536 114806610 699576470 557408258 791024254 834330434 864299600 990345346 407710218 472909646 679506437 108497390 792292058 262458697 770080060 721503672 77729186 893564216 193649039 971517971 491276846 943387878 240489859 166647681 894296124 601350457 66417526 952409381 68965540 50072…
Output: 426

Example 2:

Input: 66 793765644 625310555 407844466 146816615 465771734 111853068 968880982 425439949 724019183 504848435 690491686 994775648 622313096 416444182 617831564 986421347 563737256 72582038 483024127 392381147 68470600 823133454 570257784 524046526 278134506 297274879 80369711 67786189 48560842 32198308 830497053 760106737 819602481 214659633 682211603 16417731 914796889 595559322 905466219 433706961 388294660 476672698 478497017 924710722 701770360 706179420 543593721 737789088 708085621 859575735 507876798 958734426 788490186 571869793 182227411 601595314 983975073 116199295 262362210 150075332 276496868 365039484 110646189 955521636 697625915 718297598 551707184
Output: 53

Example 3:

Input: 146 342491184 137824287 440283137 542962992 924223185 935300902 466979048 764328102 341377351 2509137 751237796 417180536 564001305 44305769 32259268 952838577 944067740 494613822 333710371 876097157 786587352 678259198 155807211 45828951 826173144 396232287 305626704 636192329 253973036 268295190 9718885 223068744 377661579 874295909 86630062 956921910 319144885 8466717 261145155 510373978 771851028 671561169 724712417 377986076 903254027 480248569 444936937 815785844 837512085 963179705 318543179 482598524 717444883 930659882 527064391 501419771 728821662 776154562 520546655 700376583 370068066 170604284 849706112 171213302 907843440 197013982 157405711 181041248 122340244 962878437 692503360 90338160 138737612 13697915 496846986 769962563 995476096 6117334 176991035 849267200 991600122 …
Output: 51

Constraints:

1 <= n <= 787; 0 <= a[i],x <= 1000000000.

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