CT26859

Yara's crates Occurrence Count

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the boar woods of Tuskmore; Yara weighs the day's crates manifests and starts the calculations. 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 <= 271; -1000000 <= a[i],x <= 1000.

Example 1:

Input: 98 -174970 -244775 -147766 -200040 -186753 -239654 -18379 -250048 -663718 -294264 -755987 -516033 -15456 -807612 -413083 -54268 -224739 -846471 -66957 -267283 -788759 -121584 -512992 -191031 -736134 -115294 -187085 -256153 -26872 -88288 -552244 -154226 -789942 -326091 -128951 -589801 -549568 -585803 -476272 -437322 -872973 -161974 -593913 -144600 -273405 -648954 -63960 -224975 -679387 -304598 -254285 -169168 -67680 -823009 -260341 -941698 -553443 -245168 -189789 -810625 -99155 -834228 -131807 -514874 -659292 -600600 -422452 -191276 -85409 -234054 -804358 -498025 -405901 -666451 -89814 -274789 -156419 -7039 -650465 -619542 -498560 -978194 -545647 -523486 -743677 -726925 -73104 -946641 -670997 -427985 -149303 -641889 -389392 -37708 -749034 -145111 -465713 -232868 -996181
Output: 0

Example 2:

Input: 102 -810923 -466527 -215705 -158064 -173068 -997071 -726187 -956482 -211463 -355670 -504002 -783977 -443603 -686466 -384453 -397881 -98841 -681039 -553283 -177376 -593437 -322304 -893829 -271596 -766115 -662937 -308060 -982889 -369841 -604313 -436789 -235031 -484701 -896899 -846057 -877913 -207269 -380224 -67996 -611283 -849971 -933948 -33462 -900132 -867903 -373252 -565847 -395452 -167134 -496176 -965585 -358761 -842642 -596448 -986999 -796855 -563860 -162283 -372838 -481438 -304942 -941346 -485454 -459913 -537876 -295019 -602684 -680759 -983146 -279628 -55884 -257201 -290945 -694261 -580888 -925630 -1960 -125301 -435657 -708752 -462988 -788513 -152972 -773471 -694751 -516977 -389191 -274244 -551508 -673465 -768491 -901324 -186537 -636128 -8112 -428015 -541906 -828492 -477556 -811677 -637…
Output: 0

Example 3:

Input: 84 -913521 -572677 -669499 -263471 -961649 -283914 -239854 -59092 -552073 -125109 -842618 -66272 -386671 -872849 -713428 -772556 -606950 -274128 -223968 -996612 -339435 -615781 -778677 -772937 -438358 -462497 -541698 -57855 -471982 -46796 -266032 -136003 -850939 -509449 -131748 -904564 -540784 -810438 -753855 -990925 -955105 -376300 -908805 -121980 -496268 -339243 -918441 -302135 -948930 -659125 -405403 -14008 -628041 -883776 -511860 -607593 -688770 -325303 -908825 -519780 -535581 -56731 -37576 -577681 -764893 -700969 -867296 -502642 -589538 -377256 -734366 -297606 -784892 -752489 -843008 -654161 -189288 -233166 -796732 -400533 -503722 -288777 -805837 -693478 -961240
Output: 0

Constraints:

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

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