CT22050

The Luminar Occurrence Count

EasyL3 · Syntax SurferAcceptance: 0.0%XP: 20

The harbor bell rings at the crystal caves of Luminar; Urmila 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 <= 597; -1000000 <= a[i],x <= 1000000000.

Example 1:

Input: 506 501275081 970563483 522753229 212652325 212081515 195357947 26570774 165115136 95143088 956358662 350477670 636435489 272590886 74987645 878041711 48846171 239396312 786686515 166343616 118860109 840809667 753359269 78454780 204830534 392939295 966878688 550486100 589234032 227021148 936262606 144299213 349704647 877977008 699118657 681404543 826786441 341069425 233750310 75460945 453544664 488247871 117571396 951757253 801903264 599843220 833859382 503646959 419206349 600597968 398308680 745513758 389199631 26699242 108988430 291705171 39173257 211689843 738248399 197238360 248731324 826885097 375734953 756225771 109368309 347983485 696005825 639852994 188586077 197617894 476276553 45371142 641171072 283409213 148402212 138951033 435386649 927108860 878498354 705008404 885725137 90237…
Output: 0

Example 2:

Input: 308 635530761 825337699 310538414 405137743 82327197 945542812 428590401 443802782 292661477 157766250 970833149 242749674 216382007 419050851 382921381 231944583 232991852 795747994 47984755 443183522 234212908 737387845 233658986 364836175 642480778 182587639 353671637 311026508 178944114 634722694 982346456 483471595 282693692 669486295 757834080 114003978 983719772 604479991 243236678 350994402 123479349 306852806 255677109 850967119 578994079 609686344 906517834 4403369 753266293 425546322 203505766 739787755 370944148 316529763 647176750 975609687 855791313 537247496 391955857 430396106 177794366 436487912 487144024 357803328 227050113 289236883 36661283 655140376 264697398 696908123 83548331 456995860 936577342 349819537 657785983 288655799 405400438 312387400 214772825 72952271 824…
Output: 0

Example 3:

Input: 186 540642824 216778074 586887043 985568870 599267476 534332762 435973378 164858192 635140703 453030105 813359420 91964156 983150010 421016804 53462837 873926740 659272562 136527880 849246727 311542477 676007732 796865620 688165728 392032683 763988608 546061312 801297059 271899744 927833514 599402289 856933245 571222020 689228554 634770764 544415343 484906642 557329338 96592076 403166089 357220711 808458298 948761124 473175377 888359109 434193385 217467743 753035934 26773077 112473471 588960207 488608306 513516881 129357525 839753030 288276396 735969804 87023366 746373116 125829404 27919513 659649546 110294453 264092420 976004746 62216355 957213823 472893655 320208069 229949521 181115181 212677940 122777211 33672482 354427167 114339995 832015945 863892438 134836369 385626338 8017780 532620…
Output: 0

Constraints:

1 <= n <= 597; -1000000 <= a[i],x <= 1000000000.

Loading...
Test Cases:No test cases
No test cases available.
The Luminar Occurrence Count - EASY Coding Problem | CodeTikki