CT27060

The lanterns at Padmore

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

June runs the customs house at the lily shoals of Padmore. Today the books show a list of lanterns, and the numbers must be worked out before sundown. Task: Read n integers and a target x; print how many times x occurs. Input format: First line: n and x. Second line: n space-separated integers. Output format: Print the number of occurrences of x. Constraints: 1 <= n <= 567; -100 <= a[i],x <= 1000.

Example 1:

Input: 384 70 305 963 592 365 16 348 -36 667 676 258 72 366 923 186 825 154 696 464 627 815 965 225 -63 122 -34 -5 -7 16 501 758 -51 426 478 396 874 159 837 531 790 811 376 -79 791 193 564 137 388 896 366 326 644 162 238 509 535 718 620 -21 929 32 238 951 -32 363 913 -61 667 -50 209 115 996 -6 128 -61 410 32 2 135 515 662 998 -48 100 897 465 171 -85 959 76 541 219 274 680 538 779 417 938 483 343 881 790 795 340 575 847 574 878 337 192 -62 432 103 885 715 764 353 114 -98 -69 47 602 768 397 550 144 450 245 987 487 -27 166 224 394 676 605 -97 953 428 813 769 226 374 979 68 765 639 58 859 362 664 279 253 795 223 887 598 813 637 934 435 426 226 550 592 397 -48 137 90 151 667 719 581 663 547 482 0 866 600 450 735 114 145 256 970 379 681 82 84 508 -7 284 468 63 -72 288 192 248 673 623 618 384 311 -39 -9…
Output: 0

Example 2:

Input: 145 161 168 29 343 765 884 74 569 539 525 419 918 84 524 443 153 956 695 33 369 143 628 421 16 550 209 677 733 654 481 711 135 633 331 480 551 957 847 464 798 113 724 163 632 192 23 841 376 177 182 514 830 385 -58 596 149 553 50 10 542 423 503 492 466 582 -38 472 192 180 669 428 798 -1 -75 723 482 752 -66 60 42 163 259 598 460 509 42 769 403 335 833 962 64 648 113 58 157 433 112 237 136 106 -1 608 960 113 941 -58 774 299 98 208 414 830 951 -66 429 441 6 959 603 769 487 506 204 360 260 484 962 -58 635 708 927 709 133 932 599 933 433 385 971 638 281 523 233 606 -94
Output: 0

Example 3:

Input: 481 673 207 865 66 201 164 819 812 872 395 648 608 521 338 -1 116 986 749 976 794 331 732 753 667 589 676 46 276 872 939 600 -64 796 907 864 -54 337 74 595 512 868 57 -86 701 854 340 909 45 461 -33 358 77 -77 958 173 393 626 141 759 376 653 111 147 412 131 283 25 14 264 418 676 263 535 67 899 643 762 940 473 852 418 461 791 247 519 -40 -15 125 756 -85 527 604 308 877 833 820 32 614 403 -16 121 -19 312 53 472 239 706 186 675 132 293 547 960 -79 564 212 938 84 -34 226 187 300 741 380 554 826 969 350 196 -15 265 303 402 14 856 452 199 922 75 -94 231 831 575 73 406 687 958 464 435 844 847 151 915 127 615 -74 170 614 174 138 543 104 812 508 535 400 647 587 643 541 452 934 492 952 14 267 368 89 390 489 693 331 242 305 652 60 965 64 174 627 513 708 551 484 591 498 64 185 764 905 295 228 483 -39 5…
Output: 1

Constraints:

1 <= n <= 567; -100 <= a[i],x <= 1000.

Loading...
Test Cases:No test cases
No test cases available.
The lanterns at Padmore - EASY Coding Problem | CodeTikki