CT22256

Zoya's Obsidian crates

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Zoya the ledger master watches over the ember mines of Cindercrag's stores of crates. A careful computation stands between order and chaos. 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 <= 931; -1000000000 <= a[i],x <= 1000.

Example 1:

Input: 14 -493590423 -750645047 -238401268 -316678957 -370530127 -513603226 -370655975 -644212718 -713722581 -65261140 -226873052 -850870782 -36727877 -685760691 -825723466
Output: 7

Example 2:

Input: 596 -586605794 -40742227 -541866788 -298375307 -374713577 -105218047 -291102767 -354369132 -191395047 -244788813 -106601508 -650988363 -886866237 -422766969 -902576477 -990558108 -685726437 -856315417 -696741679 -243671375 -304491278 -121179792 -975826510 -67970893 -982399833 -508194334 -884565999 -708361504 -132293862 -760613523 -814824097 -73622316 -917523629 -799345064 -568579019 -791102196 -421323076 -349764508 -101613282 -861033499 -129176088 -211313183 -711769567 -842436487 -562249986 -125348744 -233383859 -241008164 -903428136 -680457709 -66244462 -247156692 -823694725 -154627197 -814593857 -203981398 -858966118 -566245918 -578031948 -455009191 -961947859 -847350236 -907305928 -448349553 -868938749 -182545536 -244880941 -561878757 -990906537 -650114053 -156450985 -797183856 -4114829…
Output: 258

Example 3:

Input: 260 -460096125 -829783664 -295436109 -926746964 -537492553 -577983034 -215003212 -930583810 -795197563 -490761937 -65827906 -109863 -480544816 -52155332 -735247278 -606744780 -80850522 -832326110 -313193664 -564243583 -235466101 -92882589 -643139856 -976239258 -588103446 -942651474 -957166264 -73104368 -414720318 -68907079 -781318877 -442445178 -858974822 -566045250 -395815479 -754301502 -884060171 -238733637 -595943686 -146628636 -881822938 -696957792 -907965115 -417539383 -145616095 -957344489 -809116570 -180151934 -264597310 -872950291 -68575881 -475839380 -34531206 -71071837 -299305395 -741683561 -646593122 -620658898 -635663184 -632678982 -743096382 -416058161 -114820096 -764539229 -830323505 -672526543 -974446578 -938652797 -534175734 -496124393 -883065313 -916681882 -250522066 -1860…
Output: 139

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Zoya's Obsidian crates - EASY Coding Problem | CodeTikki