CT22073

Kate Counts the crates

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Before the gates of the copper works of Verdigris close for winter, Kate must finish the crates 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 <= 799; -1000000000 <= a[i],x <= 1000.

Example 1:

Input: 694 -813156254 -269368171 -261620017 -508655500 -404058362 -700575893 -405151543 -243843762 -934841969 -442425670 -117283848 -64505388 -919478354 -562780940 -71978861 -702802742 -356968695 -855538543 -450700291 -839354346 -952870943 -876565021 -685337973 -725341577 -924525616 -334902969 -392437220 -312839348 -947262454 -978652320 -868231069 -969203363 -485008359 -334832464 -834843965 -402932323 -2588164 -678280698 -179049827 -590981253 -327241404 -359079932 -199506248 -202143001 -773983972 -661696401 -928933430 -919830008 -78119293 -759258841 -502406419 -153244391 -896780725 -893204654 -27125104 -855125640 -485682455 -360664412 -808753981 -517684182 -991273723 -747095153 -510295614 -87337587 -670365554 -246548595 -826542533 -989980122 -692438618 -3605661 -212893375 -196914344 -256437683 -8…
Output: 160

Example 2:

Input: 655 -808305489 -906488571 -806225655 -943396108 -366035415 -288263187 -220311181 -477274568 -126923416 -435037302 -130037751 -28037203 -506135874 -919715944 -573860070 -610010514 -278272654 -715110266 -321017201 -518657412 -670609734 -290863590 -816052628 -362969389 -705286372 -82567915 -562445333 -160814690 -493997708 -624001294 -293244096 -257157822 -467078496 -902707339 -368654064 -145515980 -18171567 -205027471 -694060890 -179842936 -133581366 -637978133 -995100269 -473175891 -188939755 -843984739 -593192239 -499065185 -492904392 -768498028 -22510188 -126447038 -935838207 -232298292 -882150664 -582319818 -399578205 -343223923 -773101988 -602130872 -477919027 -690521708 -155484099 -888924874 -792368670 -131186814 -301477536 -234626267 -992284413 -37725795 -217995219 -740621168 -78937969…
Output: 125

Example 3:

Input: 40 -879655315 -358664291 -773288917 -342948124 -278776889 -472109002 -538568834 -669656300 -139734863 -668351179 -512741942 -393740024 -636281868 -861099065 -461459464 -625139196 -112927334 -317407291 -664298906 -477076077 -797946758 -480230406 -102618811 -454465451 -525416522 -676970573 -794288877 -460810753 -871368909 -748769090 -605207204 -510145768 -484565901 -297666379 -925302871 -818129631 -455277879 -425984517 -76312790 -364867595 -404214863
Output: 1

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Kate Counts the crates - EASY Coding Problem | CodeTikki