CT25230

The Zigzag At-Most Tally

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

Every season at the basalt cliffs of Obsidian Shore, someone must audit the season's records. This year the task falls to Porter, armed only with the weights register. 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 <= 470; 0 <= a[i],x <= 1000000.

Example 1:

Input: 316 758172 157076 613286 459969 784111 758223 17971 321421 867212 840003 745642 810646 805345 893083 991621 491443 89907 28518 824245 880325 271983 564227 658295 483364 628344 531019 76376 449329 712921 768892 186895 611482 282905 710864 360259 437026 4745 448693 889520 709962 330892 407806 82048 713725 755421 715804 802272 964634 600003 237155 629083 957023 407178 684940 324072 900620 173704 953446 896208 408004 603547 328516 792548 445730 499851 558282 475259 152305 53435 45060 287085 944192 525230 332645 373395 656292 788433 267520 886836 463141 120750 820774 9794 19618 605024 400206 235169 964914 811143 732096 850611 336848 426381 655071 315214 155359 306189 394603 682292 955394 982 276782 864848 669715 281626 302948 326272 306879 595620 739747 793600 731542 610192 901208 866395 961512…
Output: 230

Example 2:

Input: 406 109934 274714 154501 30699 579685 721568 943998 331606 725043 164081 408353 773580 873365 609910 269134 957024 145202 34021 145093 675546 387369 740900 880647 989507 448984 108991 215271 624016 58342 115880 597881 863077 584847 876298 437263 395883 330304 871040 888491 643472 132213 734684 91359 895601 641805 464059 443480 278012 270099 958852 116049 69919 716211 147859 214924 708762 145504 900580 659583 363101 151573 77794 863538 263266 641452 882494 127171 728974 367722 463160 761216 38463 258874 245989 348612 12975 737794 594451 256214 386358 556352 271835 890689 531219 963986 933130 283575 501065 29958 874337 927663 694404 827289 363641 375638 804350 111700 857435 210720 814154 63992 314010 986333 173564 672814 851357 37657 693959 240710 908341 516926 395272 850508 593348 158529 74…
Output: 52

Example 3:

Input: 361 476685 749076 19836 954250 528090 385030 231143 910666 343435 521584 120985 76125 58036 319091 512380 609609 893620 327440 544584 484828 499526 37582 65896 751415 487939 126273 18499 530492 522807 912411 99671 21601 925589 301563 318973 310512 542509 66701 980193 834235 189723 913866 676615 351841 126995 988345 882457 812192 870376 254581 848551 621689 515366 861716 901037 213739 207138 733808 966758 5950 852302 248519 54311 297585 967346 992228 547058 32110 817673 754101 745811 754881 791848 480237 590429 825316 458619 969160 121878 537582 903526 383232 848210 477103 757055 73315 436135 172314 101086 682178 724255 900843 178276 136592 511901 287910 758018 819697 272124 408049 51385 712829 709918 889711 891936 432863 535808 451831 740787 366931 288849 109013 79082 360480 595704 746797 …
Output: 171

Constraints:

1 <= n <= 470; 0 <= a[i],x <= 1000000.

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