CT23186

Last coins of Zephyr

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

It is audit day at the mangrove channels of Rootwater. Zephyr spreads the coins records across the table and picks up a sharp pencil. 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 <= 302; -100 <= a[i],x <= 1000.

Example 1:

Input: 221 121 121 822 42 -46 -25 -24 55 496 194 529 779 276 426 471 195 900 758 -86 788 569 206 195 41 225 112 619 22 478 7 -28 102 179 903 987 35 425 428 954 -52 -43 881 364 816 -30 772 -28 -72 311 778 602 257 119 -89 887 431 805 848 475 -34 675 170 389 437 -10 -94 699 241 885 323 98 98 298 211 669 415 826 372 193 105 339 721 88 750 387 498 393 344 591 647 332 152 861 706 101 566 954 877 196 594 781 498 678 819 934 687 401 723 835 20 909 860 935 55 80 906 522 28 940 452 739 398 134 538 755 433 298 51 521 938 -40 738 101 71 424 510 794 1 676 515 529 966 25 774 -58 965 87 461 215 692 676 436 7 152 978 -60 395 547 369 535 -48 756 575 587 10 461 -69 366 329 888 44 894 721 818 781 481 849 847 154 -97 626 366 71 894 588 20 647 751 399 940 631 277 929 -78 468 905 299 271 836 870 599 154 -91 -13 76 317…
Output: 1

Example 2:

Input: 8 156 639 783 497 71 624 706 911 -32
Output: 0

Example 3:

Input: 230 75 781 324 605 218 277 938 97 349 342 569 804 452 650 280 608 188 889 676 993 849 338 807 696 928 533 -4 1000 15 953 143 414 42 418 172 71 576 583 780 228 139 583 40 878 935 454 702 329 288 168 -5 419 286 189 387 971 913 331 607 898 268 447 566 -97 258 236 -50 345 350 655 327 435 566 783 681 -84 -87 398 -34 724 619 308 161 435 87 970 239 -53 928 581 729 838 794 715 889 257 228 755 520 646 190 814 646 838 655 783 239 981 460 401 391 540 950 386 59 975 332 277 544 302 451 310 830 492 -45 987 533 26 980 149 184 644 742 365 497 422 30 848 577 674 563 29 389 -60 246 712 69 973 440 -4 316 -70 509 975 923 158 970 415 434 677 204 864 904 695 96 813 900 24 86 -4 -31 121 722 804 788 36 469 840 393 22 189 794 60 115 172 913 134 504 738 222 700 474 7 633 275 530 784 931 732 993 726 -73 -87 629 166…
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Last coins of Zephyr - EASY Coding Problem | CodeTikki