CT30176

The registers at Argentium

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Uday inherited the dairy at the marble forum of Argentium along with its curious bookkeeping system for registers. Time to make sense of it. 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 <= 6049; -1000000 <= a[i],x <= 1000000.

Example 1:

Input: 840 343606 982106 445566 730563 -69685 713613 973303 -668599 524119 -986436 -438538 -818895 501260 -775208 -412555 -575601 94743 -709650 908107 -579015 665555 -461413 90729 824262 -995538 -294566 654813 -66108 -431686 894726 -324893 -875789 -888772 -761046 -82044 -482502 19461 594270 614222 601245 56107 -488528 -29662 633406 -675941 675842 654160 -760220 2909 -462879 -330272 -291520 -448449 -642369 270188 698834 352938 -362702 -96576 -227375 -255671 -147296 -594708 806028 -952224 -107797 890587 979159 230212 859515 -690569 -120292 284434 770745 466345 -885590 -722087 -413002 114887 -956208 77314 246477 -886734 53188 -370881 -7266 -213097 -245861 893562 869134 824695 712411 -680606 -751929 667898 489767 -399475 377073 -636663 -906299 533767 -962104 -401156 -642413 252467 684960 185019 18737…
Output: 539

Example 2:

Input: 387 768205 760418 822195 364856 -101821 -547958 470514 975257 -916866 715635 935908 -648040 327784 688294 7178 488724 -749539 785676 71045 -277771 522627 675178 162835 -709035 457007 -283981 -134532 -380271 -508351 -113788 -767419 669293 832750 -35776 581893 93884 800956 -360574 -915054 725633 267293 -459963 840277 707900 -753049 -209067 -326572 322474 -643292 841021 -991366 -320558 -646515 -340518 429618 492615 -668626 157328 668284 469021 -171028 -441900 -193905 973282 289428 -500053 -74863 939353 -335365 -901563 -907167 -485124 368667 4876 225643 -353080 -174229 -89632 -496975 -958236 -617536 -53459 336939 -960256 481103 375066 -275940 28033 552690 469237 -596282 715486 781623 -950583 -205474 -319666 481174 -438474 -721970 137302 -3888 -660804 964823 -105300 885415 -690548 363717 84383 …
Output: 347

Example 3:

Input: 2923 872968 -278572 -102744 -747852 -537298 26055 -250406 -675790 -741738 97134 -620199 -87427 -833140 -943295 100563 -652357 -646209 591893 330969 -276434 -730179 -978200 -88302 27390 210640 -623330 90443 -520269 -152956 400342 -441461 863132 -710950 638416 288894 -813498 -517548 -852908 664013 -18221 766835 -907962 -11719 -641976 605940 829834 433672 592144 158391 892058 223616 -636451 756939 -215633 -501355 329635 375129 -707469 120118 244298 -292883 -453606 693745 705829 793046 593385 397140 534982 427060 233671 390511 -797359 -717579 848936 -597058 -263023 122375 -743513 -648695 544029 -941488 539562 722620 -73613 -949211 896248 -216225 846630 -878247 760023 -394367 260186 -963223 -560639 221900 24619 -739919 180388 -82114 57718 -416819 -873104 931322 555523 -545503 68933 3170 238553 …
Output: 2735

Constraints:

1 <= n <= 6049; -1000000 <= a[i],x <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
The registers at Argentium - MEDIUM Coding Problem | CodeTikki