CT27716

Ulric's weights At-Most Tally

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Before the gates of the poppy fields of Scarlet Plain close for winter, Ulric must finish the weights ledger - one figure at a time. 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 <= 602; -1000000000 <= a[i],x <= 1000000000.

Example 1:

Input: 542 17205373 -497230104 793250902 387505089 -262196652 543306695 -221377464 647078744 -955240531 677889623 789678169 -478206552 -785217117 557422486 -24155983 354692596 801843876 -544266191 930239893 913421314 -536290798 615927343 823107683 889484959 -41722131 207583039 840479742 -342122063 -880579835 100515839 -844095225 226071609 -110937282 -210504305 -177564015 -568235579 -132696244 64977419 815916011 364107910 -259879514 817199359 -200768827 -715901226 -415920811 373672125 910266055 70439908 -35798403 -452397681 -329593285 -551682624 -674963776 339025804 190750848 641066330 -852417792 837397725 -124390829 158796284 448476270 -392580667 -562289040 -507400987 689710112 -185250772 -689928964 -398537296 -598429828 -119502642 511176882 -438365224 802042337 -934306850 618097958 -841481550 -8…
Output: 266

Example 2:

Input: 63 272790058 984053055 146120397 230378629 754580021 348760946 -818717594 -543840371 409105853 -12388765 821378915 -528234724 190739005 7680615 -54553989 219339153 895930024 -401586722 933237256 -102958569 896229872 -499209862 164113939 550901512 -519394960 788236771 -222411447 284776185 862131664 -845195251 124882391 322159437 -953571883 363917153 -499002512 -528546140 589701019 -386416048 894219210 310892542 -156826107 -370489514 657626077 -722093912 386102520 270740495 292312009 238946634 799176663 -829902025 68397436 -707390870 991229888 -867728019 1859817 -990560536 -430396602 924896399 258205177 -722238639 900576977 298297090 -815923115 -525002134
Output: 38

Example 3:

Input: 233 -724394750 -865269400 -334844254 -240724036 341637805 -676394063 702434919 -116308250 744581107 41418575 -504458623 590509076 -262598278 -447822691 -411315459 753780464 544152770 -610928226 85902860 725768584 -410784267 272187984 -376678220 -238293507 -652954714 -203865816 -562517744 -289247733 -968110001 -750492607 -286811124 273012175 980681648 -990425327 -416649197 624815858 512267022 171387715 -839082918 559541094 691142593 -380533156 950295087 -824869706 330132929 85540786 -345204916 -450576466 153595456 880312953 -735003407 20226886 -847292122 337700550 266394413 56474678 -864875920 675194368 883234593 772418855 -76744065 644550695 -183818658 888756811 -630438208 -171057473 160948781 449046632 148578274 425843922 -205713792 -467642407 -547591091 145258169 718895177 290131566 -548…
Output: 34

Constraints:

1 <= n <= 602; -1000000000 <= a[i],x <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
Ulric's weights At-Most Tally - EASY Coding Problem | CodeTikki