CT32790

The Peculiar At-Most Tally

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Before the gates of the ember mines of Cindercrag close for winter, Chaplain must finish the vials 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 <= 5039; -1000000000 <= a[i],x <= 1000000000.

Example 1:

Input: 113 273744751 -594413747 -492293518 -916824754 -267528766 -729391221 126526384 -854484425 320050633 832256792 14947962 752444718 -645167055 -260828193 655464442 81540478 -76611330 -206800327 414098329 704813095 955149345 -905179001 -304393269 664190130 405871631 58541921 -541801858 540967311 754855396 181322929 -703222944 696045885 -842598838 -225628528 14601212 -591365624 -177788468 788238794 -793521604 -859292992 -545782184 540732148 -135155384 -565897582 -111171984 -331445408 764284219 846430563 -944675961 211849473 790431985 -203029208 60295665 225251476 980157132 -27097980 -991346341 837435313 460051715 245245353 767908887 697485422 538114180 -627937106 -741075608 -261491403 992542025 501957867 -678533850 -823669592 -968681371 -817700021 412038582 -640522332 -299702227 -941177976 7520…
Output: 69

Example 2:

Input: 234 599607783 -686518195 328673269 -261854221 -629320455 713639402 831299062 -122380700 244398578 920195676 -850715970 552287595 -559260958 495281808 -473996198 -520473118 99925129 -152487022 846715768 318270243 173643905 1371156 -120616213 556274008 -694447355 -942113819 -822023373 -591055223 -461920589 577256091 -701074418 -162817675 691390631 840326812 777586839 222778977 603217436 471816814 651687975 64139526 582425395 -712341100 -894658698 948903784 -390899969 83696418 613647172 -89260652 -3050193 884135088 -227910286 -24199284 -462044532 -890533702 161809022 136245612 731823410 755446159 531239797 710891395 533393732 -771568860 401798702 -661125173 -648722354 533703850 -902453618 815369760 971665559 -681162430 -25624927 192331861 -225104711 555887613 172026302 -668273970 -540467118 2…
Output: 175

Example 3:

Input: 3184 -228945288 -8069239 -822589363 35653036 878150216 -359426804 746121159 965359316 -385637595 338992317 268205725 647929363 658603494 -43045790 -216281503 -432470205 689593852 -346048680 896913215 -379486320 346472953 -292363246 459324922 12310450 -820668425 -326038232 648113909 -231872983 573210725 739184556 -758204759 434812335 702882299 399974517 103323300 -554164957 905181363 -953633244 -157013151 -808213788 63612735 148793363 11313774 86524333 -663780873 408685766 -570869814 776488543 -44505193 500059817 903797783 243530467 -29280483 785013124 -189321844 71778925 160499958 972205397 810280754 244666614 -258899312 375515869 438460803 543646649 -482528675 -807455433 -265323091 238837974 -576256579 743386130 -581903799 963969266 451465674 845936067 -386265670 -919097639 348020315 -438…
Output: 1195

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Peculiar At-Most Tally - MEDIUM Coding Problem | CodeTikki