CT1113

The lanterns at Serpentis

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

At the jade shrine of Serpentis, Bishop records each lanterns in a worn leather ledger. The guild wants answers, not guesses. 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 <= 52; -100 <= a[i],x <= 1000.

Example 1:

Input: 36 -49 37 377 951 557 736 175 867 815 954 97 213 -75 505 75 121 657 834 666 185 -57 770 850 378 811 241 295 938 378 527 133 781 -1 818 -74 398 280
Output: 0

Example 2:

Input: 46 923 -6 139 312 429 828 495 381 592 386 802 903 722 481 595 861 69 728 536 11 760 954 29 512 658 550 623 910 235 804 -1 73 885 603 892 31 667 -46 566 634 660 -78 -73 114 689 151 29
Output: 0

Example 3:

Input: 49 641 470 16 745 610 200 961 688 446 146 443 371 -36 -8 266 212 437 127 960 492 504 855 741 647 638 341 159 224 904 633 45 250 98 568 788 900 997 423 533 -32 807 649 363 146 782 170 761 918 835 357
Output: 0

Constraints:

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

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