CT34490

The At-Most Tally at Caravanrest

MediumL4 · Loop LordAcceptance: 0.0%XP: 35

Lata the factor watches over the dune sea of Caravanrest's stores of ledgers. 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 <= 5892; -1000000 <= a[i],x <= 1000000.

Example 1:

Input: 1649 433542 -591597 -426957 -950780 16257 232079 185632 -284961 -711957 263066 -69992 612813 970379 -724433 -756193 -953349 -346081 943778 508199 -87748 -349882 -922265 531185 989233 -946136 -630506 721589 -154734 -112867 754749 370430 -251946 196858 -285187 -768417 25296 327830 -86449 203930 626477 187930 925961 726175 398583 280965 -329296 544555 221932 -549744 -523302 8541 18336 236161 -685313 -924516 -199105 -279661 559519 915718 -366483 644459 -484652 361764 683581 -650732 -685199 252082 527051 -449622 -150213 -641620 -996345 -258051 -153837 -602824 -320278 910332 876767 -520055 -447691 -890935 -4249 874622 4104 -572807 297609 852709 -434466 -538936 151296 276295 -541630 -691408 465368 87896 249839 554168 -530505 -263236 -834016 -38732 86271 -947156 -291442 189091 983252 275048 -53632…
Output: 1201

Example 2:

Input: 4826 -278061 241716 -933255 549747 121955 -219264 319822 874703 -689730 -700416 -189694 981054 -286946 -563979 -279780 120049 -360314 559889 -966635 813746 -479222 819365 -556386 335674 136427 -419615 161676 -460837 799996 -894633 339811 -756951 132498 557737 53188 93753 -101808 -703077 211162 438112 800788 578790 401361 767286 -846027 739292 283751 -394054 -363933 685725 500065 -531514 -610426 -464396 -218799 -826466 339723 -304909 -79766 215037 -458987 826177 -422277 -610284 -416710 958089 -400985 -609743 -98769 -888293 185985 750461 495450 -749274 717113 -360977 -245171 -567484 -767595 -802427 418103 629774 -39569 503961 637639 -695551 276082 786447 730088 435540 -307968 -464886 402442 910590 844269 970255 345113 -131000 -573959 760494 -577741 -42154 130525 -852647 615372 -99162 -263602…
Output: 1753

Example 3:

Input: 4707 -530211 736583 -836858 -845830 -179800 -417205 958165 -737001 -20840 844867 -361437 905491 -127088 47203 468854 268586 293636 -531830 -650856 264537 -72376 -234462 -60859 549115 898804 521204 -283532 490898 -708606 -737616 -190942 -256710 -425411 -489324 -212224 -657915 992944 960392 -579363 -753813 -712005 -923523 -416881 691602 238538 622886 -447205 867508 894261 345280 993009 -794063 -296368 -990850 254295 -690603 912442 559423 784751 937706 858398 340323 -293676 249320 476676 797345 -991730 -842597 192735 -965678 566968 -493793 -682336 158597 325869 163882 349960 -7771 -636838 -833344 242909 452267 -338234 842131 -141526 -574257 -799282 936562 904891 -157417 -954828 -743232 -322011 -967395 576864 859664 402930 112557 -907440 -991096 932678 6503 -89794 154195 -264386 -972253 788990…
Output: 1090

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.